gpio: rcar: Fix error path for devm_kzalloc() failure

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: df0c6c8023 ("gpio: rcar: Add minimal runtime PM support")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Geert Uytterhoeven 2015-01-12 11:07:58 +01:00 committed by Linus Walleij
parent f1d2d081e8
commit 7d82bf3419
1 changed files with 2 additions and 4 deletions

View File

@ -372,10 +372,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);