summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2009-11-10 11:02:08 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 11:55:22 -0800
commited7487c2c28560a6b06900851ab63ebca1aea444 (patch)
tree0c63d86549aa083f1751f0c39270d729318bb56a /drivers/usb/core
parenta33279dfd825846325546b4d42d542b214ccb8d9 (diff)
downloadop-kernel-dev-ed7487c2c28560a6b06900851ab63ebca1aea444.zip
op-kernel-dev-ed7487c2c28560a6b06900851ab63ebca1aea444.tar.gz
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 <error27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c
index 222ee07..bfc6c2e 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;
OpenPOWER on IntegriCloud