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:
parent
68cfe9a286
commit
228cd2dba2
|
@ -550,6 +550,8 @@ EXPORT_SYMBOL_GPL(strp_check_rcv);
|
||||||
static int __init strp_mod_init(void)
|
static int __init strp_mod_init(void)
|
||||||
{
|
{
|
||||||
strp_wq = create_singlethread_workqueue("kstrp");
|
strp_wq = create_singlethread_workqueue("kstrp");
|
||||||
|
if (unlikely(!strp_wq))
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue