Skip to contentSkip to conversation

gpio: rcar: NULL dereference on error in probe()

PATCH In review Dan Carpenter 3 participants 3 messages Nov 7, 2013 – Nov 18, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: rcar: NULL dereference on error in probe()

It's not obvious from the label name but "err1" tries to release "p->irq_domain" which leads to a NULL dereference.

Fixes 119f5e448d32 ('gpio: Renesas R-Car GPIO driver V3')
drivers/gpio/gpio-rcar.c +1 -1
index d3f15ae..fe088a3 100644
@@ -381,7 +381,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
 	if (!p->irq_domain) {
 		ret = -ENXIO;
 		dev_err(&pdev->dev, "cannot initialize irq domain\n");
-		goto err1;
+		goto err0;
 	}
 
 	if (devm_request_irq(&pdev->dev, irq->start,
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Dan Carpenter

It's not obvious from the label name but "err1" tries to release "p->irq_domain" which leads to a NULL dereference.

Fixes 119f5e448d32 ('gpio: Renesas R-Car GPIO driver V3')
drivers/gpio/gpio-rcar.c +0 -0
index d3f15ae..fe088a3 100644

drivers/gpio/gpio-rcar.c static int gpio_rcar_probe(struct platform_device *pdev) · line 387

Quoted 8 lines
drivers/gpio/gpio-rcar.c +1 -1
@@ -381,7 +381,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
        if (!p->irq_domain) {
                ret = -ENXIO;
                dev_err(&pdev->dev, "cannot initialize irq domain\n");
-               goto err1;
+               goto err0;
        }
 
        if (devm_request_irq(&pdev->dev, irq->start,

Hey Dan,

Thanks a lot for the patch, it looks correct to me.

Cheers,

/ magnus