Commit 3c829f47 authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Wim Van Sebroeck

watchdog: asm9260_wdt: fix error handling in asm9260_wdt_probe()

If devm_reset_control_get_exclusive() fails, asm9260_wdt_probe()
returns immediately. But clks has been already enabled at that point,
so it is required to disable them or to move the code around.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 8d039d4d
...@@ -292,14 +292,14 @@ static int asm9260_wdt_probe(struct platform_device *pdev) ...@@ -292,14 +292,14 @@ static int asm9260_wdt_probe(struct platform_device *pdev)
if (IS_ERR(priv->iobase)) if (IS_ERR(priv->iobase))
return PTR_ERR(priv->iobase); return PTR_ERR(priv->iobase);
ret = asm9260_wdt_get_dt_clks(priv);
if (ret)
return ret;
priv->rst = devm_reset_control_get_exclusive(&pdev->dev, "wdt_rst"); priv->rst = devm_reset_control_get_exclusive(&pdev->dev, "wdt_rst");
if (IS_ERR(priv->rst)) if (IS_ERR(priv->rst))
return PTR_ERR(priv->rst); return PTR_ERR(priv->rst);
ret = asm9260_wdt_get_dt_clks(priv);
if (ret)
return ret;
wdd = &priv->wdd; wdd = &priv->wdd;
wdd->info = &asm9260_wdt_ident; wdd->info = &asm9260_wdt_ident;
wdd->ops = &asm9260_wdt_ops; wdd->ops = &asm9260_wdt_ops;
......
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