* [PATCH] net: strparser: fix a missing check for create_singlethread_workqueue
@ 2019-03-15 4:12 Kangjie Lu
2019-03-15 19:52 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Kangjie Lu @ 2019-03-15 4:12 UTC (permalink / raw)
To: kjlu
Cc: pakki001, David S. Miller, Doron Roberts-Kedes, Vakul Garg,
Dave Watson, YueHaibing, netdev, linux-kernel
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>
---
net/strparser/strparser.c | 2 ++
1 file changed, 2 insertions(+)
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;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: strparser: fix a missing check for create_singlethread_workqueue
2019-03-15 4:12 [PATCH] net: strparser: fix a missing check for create_singlethread_workqueue Kangjie Lu
@ 2019-03-15 19:52 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-03-15 19:52 UTC (permalink / raw)
To: kjlu
Cc: pakki001, doronrk, vakul.garg, davejwatson, yuehaibing, netdev,
linux-kernel
From: Kangjie Lu <kjlu@umn.edu>
Date: Thu, 14 Mar 2019 23:12:06 -0500
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-15 19:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-15 4:12 [PATCH] net: strparser: fix a missing check for create_singlethread_workqueue Kangjie Lu
2019-03-15 19:52 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.