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.4-rc1~1327^2~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=228cd2dba27cee9956c1af97e6445be056881e41;p=platform%2Fkernel%2Flinux-rpi.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 da1a676..860dcfb 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; }