diff options
| author | Kangjie Lu <[email protected]> | 2019-03-15 04:12:06 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2019-03-15 19:51:56 +0000 |
| commit | 228cd2dba27cee9956c1af97e6445be056881e41 (patch) | |
| tree | 2a5cbd74ef9dd24346e648c01bdf3082cee336db /net/strparser/strparser.c | |
| parent | net: sis900: fix indentation issues, remove some spaces (diff) | |
| download | kernel-228cd2dba27cee9956c1af97e6445be056881e41.tar.gz kernel-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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/strparser/strparser.c')
| -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; } |
