usb: u132-hcd: fix potential NULL pointer dereference
In case create_singlethread_workqueue fails, the fix notifies callers the error to avoid potential NULL pointer dereferences. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4c912bff46
commit
3de3dbe7c1
|
@ -3203,6 +3203,8 @@ static int __init u132_hcd_init(void)
|
|||
return -ENODEV;
|
||||
printk(KERN_INFO "driver %s\n", hcd_name);
|
||||
workqueue = create_singlethread_workqueue("u132");
|
||||
if (!workqueue)
|
||||
return -ENOMEM;
|
||||
retval = platform_driver_register(&u132_platform_driver);
|
||||
return retval;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue