diff options
author | Kangjie Lu <kjlu@umn.edu> | 2019-03-15 05:12:06 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-03-15 20:51:56 +0100 |
commit | 228cd2dba27cee9956c1af97e6445be056881e41 (patch) | |
tree | 2a5cbd74ef9dd24346e648c01bdf3082cee336db /net/strparser | |
parent | net: sis900: fix indentation issues, remove some spaces (diff) | |
download | linux-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 'net/strparser')
-rw-r--r-- | net/strparser/strparser.c | 2 |
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; } |