Commit 3de3dbe7 authored by Kangjie Lu's avatar Kangjie Lu Committed by Greg Kroah-Hartman
Browse files

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: default avatarKangjie Lu <kjlu@umn.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4c912bff
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
}