From: Adrian Bunk Date: Fri, 10 Mar 2006 18:04:38 +0000 (+0100) Subject: [WATCHDOG] pcwd_usb.c: fix a NULL pointer dereference X-Git-Tag: v2.6.17-rc1~9^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9d1a0b8d52e7539e22f3c3190f8b6e0c80b6cfe;p=linux-2.6 [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 --- diff --git a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c index 2700c5c45b..3fdfda9324 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; }