Skip to content

Commit 228cd2d

Browse files
kengiterdavem330
authored andcommitted
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>
1 parent 68cfe9a commit 228cd2d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎net/strparser/strparser.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,8 @@ EXPORT_SYMBOL_GPL(strp_check_rcv);
550550
static int __init strp_mod_init(void)
551551
{
552552
strp_wq = create_singlethread_workqueue("kstrp");
553+
if (unlikely(!strp_wq))
554+
return -ENOMEM;
553555

554556
return 0;
555557
}

0 commit comments

Comments
 (0)