All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: u132-hcd: fix potential NULL pointer dereference
@ 2019-03-14  7:27 ` Kangjie Lu
  0 siblings, 0 replies; 12+ messages in thread
From: Kangjie Lu @ 2019-03-14  7:27 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Greg Kroah-Hartman, Colin Ian King, Jia-Ju Bai,
	linux-usb, linux-kernel

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>
---
 drivers/usb/host/u132-hcd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index 934584f0a20a..6d5b532b03f8 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 (unlikely(!workqueue))
+		return -ENOMEM;
 	retval = platform_driver_register(&u132_platform_driver);
 	return retval;
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-03-27 13:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-14  7:27 [PATCH] usb: u132-hcd: fix potential NULL pointer dereference Kangjie Lu
2019-03-14  7:27 ` Kangjie Lu
2019-03-19 13:56 ` [PATCH] " Greg Kroah-Hartman
2019-03-19 13:56   ` Greg Kroah-Hartman
2019-03-19 17:20   ` [PATCH] " Kangjie Lu
2019-03-19 17:20     ` Kangjie Lu
2019-03-19 17:34   ` [PATCH] " Kangjie Lu
2019-03-19 17:34     ` Kangjie Lu
2019-03-26  4:41     ` [PATCH] " Greg Kroah-Hartman
2019-03-26  4:41       ` Greg Kroah-Hartman
2019-03-27 13:57       ` [PATCH] " Mukesh Ojha
2019-03-27 13:57         ` Mukesh Ojha

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.