diff options
author | Kangjie Lu <kjlu@umn.edu> | 2019-03-14 23:12:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-03-15 12:51:56 -0700 |
commit | 228cd2dba27cee9956c1af97e6445be056881e41 (patch) | |
tree | 2a5cbd74ef9dd24346e648c01bdf3082cee336db /net/strparser | |
parent | 68cfe9a286f3ee2371de00ab666b4949ff285196 (diff) | |
download | lwn-228cd2dba27cee9956c1af97e6445be056881e41.tar.gz lwn-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; } |