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-Url: https://git.stricted.de/?a=commitdiff_plain;h=ed7487c2c28560a6b06900851ab63ebca1aea444;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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 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;