Commit 62503026 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Luis Henriques

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

commit 7d82bf34 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: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Fixes: df0c6c80 ("gpio: rcar: Add minimal runtime PM support")
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 50992849
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment