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:
Kangjie Lu 2019-03-19 12:34:06 -05:00 committed by Greg Kroah-Hartman
parent 4c912bff46
commit 3de3dbe7c1
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}