Explorar o código

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>
Dan Carpenter %!s(int64=15) %!d(string=hai) anos
pai
achega
ed7487c2c2
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      drivers/usb/core/file.c

+ 1 - 0
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;