[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190315041208.32432-1-kjlu@umn.edu>
Date: Thu, 14 Mar 2019 23:12:06 -0500
From: Kangjie Lu <kjlu@....edu>
To: kjlu@....edu
Cc: pakki001@....edu, "David S. Miller" <davem@...emloft.net>,
Doron Roberts-Kedes <doronrk@...com>,
Vakul Garg <vakul.garg@....com>,
Dave Watson <davejwatson@...com>,
YueHaibing <yuehaibing@...wei.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] net: strparser: fix a missing check for create_singlethread_workqueue
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@....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
Powered by blists - more mailing lists