Skip to content

Commit

Permalink
USB: fix possible null deref in init_usb_class()
Browse files Browse the repository at this point in the history
Add a missing goto.  We dereference usb_class on the next line.

Found by smatch static checker.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Dec 11, 2009
1 parent a33279d commit ed7487c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/core/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ static int init_usb_class(void)
printk(KERN_ERR "class_create failed for usb devices\n");
kfree(usb_class);
usb_class = NULL;
goto exit;
}
usb_class->class->devnode = usb_devnode;

Expand Down

0 comments on commit ed7487c

Please sign in to comment.