Thread (4 messages) flat view 4 messages, 3 authors, 2019-03-26

Re: [PATCH] net: fm10k: fix a potential NULL pointer dereference

From: Jeff Kirsher <hidden>
Date: 2019-03-26 22:19:48
Also in: intel-wired-lan, lkml

On Fri, 2019-03-22 at 22:26 -0500, Kangjie Lu wrote:
quoted
On Mar 11, 2019, at 1:17 AM, Kangjie Lu [off-list ref] wrote:

In case alloc_workqueue fails, the fix returns -ENOMEM to avoid
potential NULL pointer dereference.

Signed-off-by: Kangjie Lu <redacted>
---
drivers/net/ethernet/intel/fm10k/fm10k_main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index 5a0419421511..215f232674f1 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -41,6 +41,8 @@ static int __init fm10k_init_module(void)
	/* create driver workqueue */
	fm10k_workqueue = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0,
					  fm10k_driver_name);
+	if (unlikely(!fm10k_workqueue))
+		return -ENOMEM;
Jeff, can you review this patch?
Yep, sorry for the delay in getting back to you.  I already had this
change in my tree queued up from Yue Haibing.  I am actually preparing
to push this fix and few others to Dave in a couple of hours.
quoted
	fm10k_dbg_init();

-- 
2.17.1
  

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help