diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2015-01-12 05:07:58 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-01-15 11:23:25 -0500 |
commit | 7d82bf3419c103dbb730e7834186fc5d577b9da1 (patch) | |
tree | b8d6619af4d4408772684fff7247853afaa46f72 /drivers/gpio | |
parent | f1d2d081e8d13b23ea53f32932ae03af76934b9a (diff) |
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>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-rcar.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 584484e3f1e3..ca2b6310f8f7 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) | |||
372 | int ret; | 372 | int ret; |
373 | 373 | ||
374 | p = devm_kzalloc(dev, sizeof(*p), GFP_KERNEL); | 374 | p = devm_kzalloc(dev, sizeof(*p), GFP_KERNEL); |
375 | if (!p) { | 375 | if (!p) |
376 | ret = -ENOMEM; | 376 | return -ENOMEM; |
377 | goto err0; | ||
378 | } | ||
379 | 377 | ||
380 | p->pdev = pdev; | 378 | p->pdev = pdev; |
381 | spin_lock_init(&p->lock); | 379 | spin_lock_init(&p->lock); |