diff options
author | Kangjie Lu <kjlu@umn.edu> | 2019-03-19 18:34:06 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-26 08:42:53 +0100 |
commit | 3de3dbe7c13210171ba8411e36b409a2c29c7415 (patch) | |
tree | d9fc8d0e0541f683868c4ae1382d35298a6e2e19 | |
parent | usb: typec: wcove: Provide fwnode for the port (diff) | |
download | linux-3de3dbe7c13210171ba8411e36b409a2c29c7415.tar.xz linux-3de3dbe7c13210171ba8411e36b409a2c29c7415.zip |
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>
-rw-r--r-- | drivers/usb/host/u132-hcd.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c index 934584f0a20a..e29165027e8b 100644 --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c @@ -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; } |