summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2012-09-10 12:41:15 +0800
committerWim Van Sebroeck <wim@iguana.be>2012-09-10 17:33:17 +0200
commitb232a70a1735c004f9ee6fdf363def527b9234b6 (patch)
tree7c0ece61c982e452206d40fb2ffb8d22c22632ea /drivers/watchdog
parent308b135e4fcc00c80c07e0e04e7afa8edf78583c (diff)
downloadlinux-b232a70a1735c004f9ee6fdf363def527b9234b6.tar.bz2
watchdog: move the dereference below the NULL test
The dereference should be moved below the NULL test. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/watchdog_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
index 6aa46a90ff02..3796434991fa 100644
--- a/drivers/watchdog/watchdog_core.c
+++ b/drivers/watchdog/watchdog_core.c
@@ -128,11 +128,12 @@ EXPORT_SYMBOL_GPL(watchdog_register_device);
void watchdog_unregister_device(struct watchdog_device *wdd)
{
int ret;
- int devno = wdd->cdev.dev;
+ int devno;
if (wdd == NULL)
return;
+ devno = wdd->cdev.dev;
ret = watchdog_dev_unregister(wdd);
if (ret)
pr_err("error unregistering /dev/watchdog (err=%d)\n", ret);