mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] watchdog: imx: error out on negative timeouts
@ 2015-01-27 13:41 Uwe Kleine-König
  2015-01-28  9:15 ` Sascha Hauer
  2015-02-02 10:49 ` Uwe Kleine-König
  0 siblings, 2 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2015-01-27 13:41 UTC (permalink / raw)
  To: barebox

I'm not sure where a negative timeout could come from but making the
code more robust for no additional runtime cost is good nevertheless.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/watchdog/imxwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
index 31c3d0d85353..66e9f6848f74 100644
--- a/drivers/watchdog/imxwd.c
+++ b/drivers/watchdog/imxwd.c
@@ -87,7 +87,7 @@ static int imx21_watchdog_set_timeout(struct imx_wd *priv, int timeout)
 
 	dev_dbg(priv->dev, "%s: %d\n", __func__, timeout);
 
-	if (!timeout || timeout > 128)
+	if (timeout <= 0 || timeout > 128)
 		return -EINVAL;
 
 	if (timeout > 0)
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-02-03  7:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-27 13:41 [PATCH] watchdog: imx: error out on negative timeouts Uwe Kleine-König
2015-01-28  9:15 ` Sascha Hauer
2015-02-02 10:49 ` Uwe Kleine-König
2015-02-02 11:04   ` Sascha Hauer
2015-02-02 11:50     ` Masahiro Yamada
2015-02-02 12:16       ` Sascha Hauer
2015-02-03  6:14         ` Masahiro Yamada
2015-02-03  7:44           ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox