From: Dan Carpenter Date: Tue, 10 Nov 2009 09:02:08 +0000 (+0200) Subject: USB: fix possible null deref in init_usb_class() X-Git-Tag: v2.6.33-rc1~315^2~59 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=ed7487c2c28560a6b06900851ab63ebca1aea444;p=~emulex%2Finfiniband.git 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 --- diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index 222ee07ea68..bfc6c2eea64 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;