From: Mark Brown Date: Wed, 16 Nov 2011 11:52:12 +0000 (+0000) Subject: watchdog: Don't overwrite error value in wm831x_wdt_set_timeout() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f9849100851b28c8ad83e86d68d5110497a4e9d6;p=linux-beck.git watchdog: Don't overwrite error value in wm831x_wdt_set_timeout() Reported-by: Dan Carpenter Signed-off-by: Mark Brown Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/wm831x_wdt.c b/drivers/watchdog/wm831x_wdt.c index 7be38556aed0..e789a47db41f 100644 --- a/drivers/watchdog/wm831x_wdt.c +++ b/drivers/watchdog/wm831x_wdt.c @@ -150,7 +150,7 @@ static int wm831x_wdt_set_timeout(struct watchdog_device *wdt_dev, if (wm831x_wdt_cfgs[i].time == timeout) break; if (i == ARRAY_SIZE(wm831x_wdt_cfgs)) - ret = -EINVAL; + return -EINVAL; ret = wm831x_reg_unlock(wm831x); if (ret == 0) {