From: Kangjie Lu Date: Fri, 15 Mar 2019 04:12:06 +0000 (-0500) Subject: net: strparser: fix a missing check for create_singlethread_workqueue X-Git-Tag: v5.1-rc3~35^2~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=228cd2dba27cee9956c1af97e6445be056881e41;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: David S. Miller --- diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c index da1a676860cad..860dcfb95ee47 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; }