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 <[email protected]>
---
 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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to