Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 879828c6 authored by Axel Lin's avatar Axel Lin Committed by Linus Walleij
Browse files

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: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 5afb287a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -441,6 +441,7 @@ static int grgpio_probe(struct platform_device *ofdev)
	err = gpiochip_add(gc);
	if (err) {
		dev_err(&ofdev->dev, "Could not add gpiochip\n");
		if (priv->domain)
			irq_domain_remove(priv->domain);
		return err;
	}