Messages in this thread Patch in this message | | | From | Kangjie Lu <> | Subject | [PATCH] net: strparser: fix a missing check for create_singlethread_workqueue | 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> --- 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
| |