mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-12 08:48:48 +00:00
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: df0c6c80232f2ad4 ("gpio: rcar: Add minimal runtime PM support") Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
f1d2d081e8
commit
7d82bf3419
@ -372,10 +372,8 @@ static int gpio_rcar_probe(struct platform_device *pdev)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
p = devm_kzalloc(dev, sizeof(*p), GFP_KERNEL);
|
p = devm_kzalloc(dev, sizeof(*p), GFP_KERNEL);
|
||||||
if (!p) {
|
if (!p)
|
||||||
ret = -ENOMEM;
|
return -ENOMEM;
|
||||||
goto err0;
|
|
||||||
}
|
|
||||||
|
|
||||||
p->pdev = pdev;
|
p->pdev = pdev;
|
||||||
spin_lock_init(&p->lock);
|
spin_lock_init(&p->lock);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user