mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
gpio: grgpio: Avoid potential NULL pointer dereference
irqmap is optional property, so priv->domain can be NULL if !irqmap. Thus add NULL test for priv->domain before calling irq_domain_remove() to prevent NULL pointer dereference. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
5afb287a06
commit
879828c6ad
1 changed files with 2 additions and 1 deletions
|
@ -441,7 +441,8 @@ static int grgpio_probe(struct platform_device *ofdev)
|
|||
err = gpiochip_add(gc);
|
||||
if (err) {
|
||||
dev_err(&ofdev->dev, "Could not add gpiochip\n");
|
||||
irq_domain_remove(priv->domain);
|
||||
if (priv->domain)
|
||||
irq_domain_remove(priv->domain);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue