mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
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
1 changed files with 2 additions and 0 deletions
|
@ -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 a new issue