summaryrefslogtreecommitdiffstats
path: root/net/strparser/strparser.c
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2019-03-15 05:12:06 +0100
committerDavid S. Miller <davem@davemloft.net>2019-03-15 20:51:56 +0100
commit228cd2dba27cee9956c1af97e6445be056881e41 (patch)
tree2a5cbd74ef9dd24346e648c01bdf3082cee336db /net/strparser/strparser.c
parentnet: sis900: fix indentation issues, remove some spaces (diff)
downloadlinux-228cd2dba27cee9956c1af97e6445be056881e41.tar.xz
linux-228cd2dba27cee9956c1af97e6445be056881e41.zip
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 '')
-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;
}