From c9d1a0b8d52e7539e22f3c3190f8b6e0c80b6cfe Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Fri, 10 Mar 2006 19:04:38 +0100 Subject: [PATCH] [WATCHDOG] pcwd_usb.c: fix a NULL pointer dereference The Coverity checker noted that this resulted in a NULL pointer reference if we were coming from if (usb_pcwd == NULL) { printk(KERN_ERR PFX "Out of memory\n"); goto error; } Signed-off-by: Adrian Bunk Signed-off-by: Wim Van Sebroeck Signed-off-by: Andrew Morton --- drivers/char/watchdog/pcwd_usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c index 2700c5c..3fdfda9 100644 --- a/drivers/char/watchdog/pcwd_usb.c +++ b/drivers/char/watchdog/pcwd_usb.c @@ -705,7 +705,8 @@ err_out_misc_deregister: err_out_unregister_reboot: unregister_reboot_notifier(&usb_pcwd_notifier); error: - usb_pcwd_delete (usb_pcwd); + if (usb_pcwd) + usb_pcwd_delete(usb_pcwd); usb_pcwd_device = NULL; return retval; } -- 1.8.2.3