Skip to content

Commit

Permalink
[WATCHDOG] pcwd_usb.c: fix a NULL pointer dereference
Browse files Browse the repository at this point in the history
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@stusta.de>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Andrew Morton <akpm@osdl.org>
  • Loading branch information
AdrianBunk authored and Wim Van Sebroeck committed Apr 2, 2006
1 parent 6bbc20b commit c9d1a0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/char/watchdog/pcwd_usb.c
Expand Up @@ -705,7 +705,8 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi
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;
}
Expand Down

0 comments on commit c9d1a0b

Please sign in to comment.