]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gpio: rcar: Fix error path for devm_kzalloc() failure
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 12 Jan 2015 10:07:58 +0000 (11:07 +0100)
committerLuis Henriques <luis.henriques@canonical.com>
Mon, 2 Mar 2015 15:04:39 +0000 (15:04 +0000)
commit 7d82bf3419c103dbb730e7834186fc5d577b9da1 upstream.

If the call to devm_kzalloc() fails, nothing must be cleant up.
This was missed before because gpio_rcar_probe() had a "return"
statement after the first "goto err0".

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Fixes: df0c6c80232f2ad4 ("gpio: rcar: Add minimal runtime PM support")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/gpio/gpio-rcar.c

index b6ae89ea88119b2b1d35b522f64e07470d20a8dc..c3ea3e9e3d14afac6e61c55ab28ab2d6a2d65024 100644 (file)
@@ -363,10 +363,8 @@ static int gpio_rcar_probe(struct platform_device *pdev)
        int ret;
 
        p = devm_kzalloc(dev, sizeof(*p), GFP_KERNEL);
-       if (!p) {
-               ret = -ENOMEM;
-               goto err0;
-       }
+       if (!p)
+               return -ENOMEM;
 
        p->pdev = pdev;
        spin_lock_init(&p->lock);