From 7d82bf3419c103dbb730e7834186fc5d577b9da1 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 12 Jan 2015 11:07:58 +0100 Subject: 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 Fixes: df0c6c80232f2ad4 ("gpio: rcar: Add minimal runtime PM support") Signed-off-by: Linus Walleij --- drivers/gpio/gpio-rcar.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/gpio/gpio-rcar.c') diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 584484e3f1e..ca2b6310f8f 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c @@ -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); -- cgit v1.2.3-70-g09d2