[2.6 patch] drivers/char/watchdog/pcwd_usb.c: fix a NULL pointer dereference

From: Adrian Bunk
Date: Fri Mar 10 2006 - 13:02:02 EST


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 <bunk@xxxxxxxxx>

--- linux-2.6.16-rc5-mm3-full/drivers/char/watchdog/pcwd_usb.c.old 2006-03-10 18:18:00.000000000 +0100
+++ linux-2.6.16-rc5-mm3-full/drivers/char/watchdog/pcwd_usb.c 2006-03-10 18:18:45.000000000 +0100
@@ -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;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/