diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-09-10 00:41:15 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-09-10 11:33:17 -0400 |
commit | b232a70a1735c004f9ee6fdf363def527b9234b6 (patch) | |
tree | 7c0ece61c982e452206d40fb2ffb8d22c22632ea /drivers/watchdog | |
parent | 308b135e4fcc00c80c07e0e04e7afa8edf78583c (diff) |
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.c | 3 |
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); | |||
128 | void watchdog_unregister_device(struct watchdog_device *wdd) | 128 | void watchdog_unregister_device(struct watchdog_device *wdd) |
129 | { | 129 | { |
130 | int ret; | 130 | int ret; |
131 | int devno = wdd->cdev.dev; | 131 | int devno; |
132 | 132 | ||
133 | if (wdd == NULL) | 133 | if (wdd == NULL) |
134 | return; | 134 | return; |
135 | 135 | ||
136 | devno = wdd->cdev.dev; | ||
136 | ret = watchdog_dev_unregister(wdd); | 137 | ret = watchdog_dev_unregister(wdd); |
137 | if (ret) | 138 | if (ret) |
138 | pr_err("error unregistering /dev/watchdog (err=%d)\n", ret); | 139 | pr_err("error unregistering /dev/watchdog (err=%d)\n", ret); |