提交 7d82bf34 编写于 作者: G Geert Uytterhoeven 提交者: Linus Walleij

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: NGeert Uytterhoeven <geert+renesas@glider.be>
Fixes: df0c6c80 ("gpio: rcar: Add minimal runtime PM support")
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 f1d2d081
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册