Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b232a70a authored by Wei Yongjun's avatar Wei Yongjun Committed by Wim Van Sebroeck
Browse files

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 308b135e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);