summaryrefslogtreecommitdiff
path: root/net/strparser
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2019-03-15 07:12:06 +0300
committerDavid S. Miller <davem@davemloft.net>2019-03-15 22:51:56 +0300
commit228cd2dba27cee9956c1af97e6445be056881e41 (patch)
tree2a5cbd74ef9dd24346e648c01bdf3082cee336db /net/strparser
parent68cfe9a286f3ee2371de00ab666b4949ff285196 (diff)
downloadlinux-228cd2dba27cee9956c1af97e6445be056881e41.tar.xz
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@umn.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/strparser')
-rw-r--r--net/strparser/strparser.c2
1 files changed, 2 insertions, 0 deletions
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;
}