lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1385490173-7511-2-git-send-email-dianders@chromium.org>
Date:	Tue, 26 Nov 2013 10:22:53 -0800
From:	Doug Anderson <dianders@...omium.org>
To:	Wim Van Sebroeck <wim@...ana.be>
Cc:	Fabio Porcedda <fabio.porcedda@...il.com>,
	Sachin Kamat <sachin.kamat@...aro.org>,
	Guenter Roeck <linux@...ck-us.net>,
	Doug Anderson <dianders@...omium.org>,
	linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] watchdog: core: Fix watchdog_init_timeout() when invalid param / valid dt

There was a minor bug in watchdog_init_timeout() where it would return
an error code if someone specified an invalid parameter on the
command line but then there was a valid parameter in the device tree
as "timeout-sec".

Signed-off-by: Doug Anderson <dianders@...omium.org>
---
 drivers/watchdog/watchdog_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
index cec9b55..8d27753 100644
--- a/drivers/watchdog/watchdog_core.c
+++ b/drivers/watchdog/watchdog_core.c
@@ -82,12 +82,12 @@ int watchdog_init_timeout(struct watchdog_device *wdd,
 		wdd->timeout = timeout_parm;
 		return ret;
 	}
-	if (timeout_parm)
-		ret = -EINVAL;
 
-	/* try to get the timeout_sec property */
+	/* if no device tree then we're done */
 	if (dev == NULL || dev->of_node == NULL)
-		return ret;
+		return (timeout_parm) ? -EINVAL : ret;
+
+	/* try to get the timeout_sec property */
 	of_property_read_u32(dev->of_node, "timeout-sec", &t);
 	if (!watchdog_timeout_invalid(wdd, t) && t)
 		wdd->timeout = t;
-- 
1.8.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ