From ed7487c2c28560a6b06900851ab63ebca1aea444 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 10 Nov 2009 11:02:08 +0200 Subject: USB: fix possible null deref in init_usb_class() Add a missing goto. We dereference usb_class on the next line. Found by smatch static checker. Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index 222ee07ea680..bfc6c2eea647 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c @@ -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; -- cgit v1.2.3