net: strparser: fix a missing check for create_singlethread_workqueue
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- net/strparser/strparser.c | 2 ++ 1 file changed, 2 insertions(+)
net/strparser/strparser.c +2 -0
@@ -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 ; }
Signature · 1 line
2.17.1
From: Kangjie Lu <[email protected]>
Date: Thu, 14 Mar 2019 23:12:06 -0500
Quoted 4 lines
In case
create_singlethread_workqueuefails, the check returns an error to callers to avoid potential NULL pointer dereferences.Signed-off-by Kangjie Lu <[email protected]>
Applied.