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>
This commit is contained in:
Kangjie Lu 2019-03-14 23:12:06 -05:00 committed by David S. Miller
parent 68cfe9a286
commit 228cd2dba2
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}