netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: strparser: fix a missing check for create_singlethread_workqueue
@ 2019-03-15  4:12 Kangjie Lu
  2019-03-15 19:52 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Kangjie Lu @ 2019-03-15  4:12 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, David S. Miller, Doron Roberts-Kedes, Vakul Garg,
	Dave Watson, YueHaibing, netdev, linux-kernel

In case create_singlethread_workqueue fails, the check returns
an error to callers to avoid potential NULL pointer dereferences.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 net/strparser/strparser.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c
index da1a676860ca..860dcfb95ee4 100644
--- a/net/strparser/strparser.c
+++ b/net/strparser/strparser.c
@@ -550,6 +550,8 @@ EXPORT_SYMBOL_GPL(strp_check_rcv);
 static int __init strp_mod_init(void)
 {
 	strp_wq = create_singlethread_workqueue("kstrp");
+	if (unlikely(!strp_wq))
+		return -ENOMEM;
 
 	return 0;
 }
-- 
2.17.1


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

end of thread, other threads:[~2019-03-15 19:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-15  4:12 [PATCH] net: strparser: fix a missing check for create_singlethread_workqueue Kangjie Lu
2019-03-15 19:52 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).