Skip to content

Commit

Permalink
usb: u132-hcd: fix potential NULL pointer dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kangjie Lu authored and Greg Kroah-Hartman committed Mar 26, 2019
1 parent 4c912bf commit 3de3dbe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/host/u132-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3de3dbe

Please sign in to comment.