* [PATCH] net: fm10k: fix a potential NULL pointer dereference
@ 2019-03-11 6:17 Kangjie Lu
2019-03-11 20:38 ` David Miller
2019-03-23 3:26 ` Kangjie Lu
0 siblings, 2 replies; 4+ messages in thread
From: Kangjie Lu @ 2019-03-11 6:17 UTC (permalink / raw)
To: kjlu
Cc: pakki001, Jeff Kirsher, David S. Miller, intel-wired-lan, netdev,
linux-kernel
In case alloc_workqueue fails, the fix returns -ENOMEM to avoid
potential NULL pointer dereference.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
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;
fm10k_dbg_init();
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net: fm10k: fix a potential NULL pointer dereference
2019-03-11 6:17 [PATCH] net: fm10k: fix a potential NULL pointer dereference Kangjie Lu
@ 2019-03-11 20:38 ` David Miller
2019-03-23 3:26 ` Kangjie Lu
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2019-03-11 20:38 UTC (permalink / raw)
To: kjlu; +Cc: pakki001, jeffrey.t.kirsher, intel-wired-lan, netdev, linux-kernel
From: Kangjie Lu <kjlu@umn.edu>
Date: Mon, 11 Mar 2019 01:17:32 -0500
> In case alloc_workqueue fails, the fix returns -ENOMEM to avoid
> potential NULL pointer dereference.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Jeff, I assume you will pick this up.
Thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: fm10k: fix a potential NULL pointer dereference
2019-03-11 6:17 [PATCH] net: fm10k: fix a potential NULL pointer dereference Kangjie Lu
2019-03-11 20:38 ` David Miller
@ 2019-03-23 3:26 ` Kangjie Lu
2019-03-26 22:21 ` Jeff Kirsher
1 sibling, 1 reply; 4+ messages in thread
From: Kangjie Lu @ 2019-03-23 3:26 UTC (permalink / raw)
To: kjlu
Cc: pakki001, Jeff Kirsher, David S. Miller, intel-wired-lan, netdev,
linux-kernel
> On Mar 11, 2019, at 1:17 AM, Kangjie Lu <kjlu@umn.edu> wrote:
>
> In case alloc_workqueue fails, the fix returns -ENOMEM to avoid
> potential NULL pointer dereference.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
> 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?
Thanks.
> fm10k_dbg_init();
>
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: fm10k: fix a potential NULL pointer dereference
2019-03-23 3:26 ` Kangjie Lu
@ 2019-03-26 22:21 ` Jeff Kirsher
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Kirsher @ 2019-03-26 22:21 UTC (permalink / raw)
To: Kangjie Lu
Cc: pakki001, David S. Miller, intel-wired-lan, netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]
On Fri, 2019-03-22 at 22:26 -0500, Kangjie Lu wrote:
> > On Mar 11, 2019, at 1:17 AM, Kangjie Lu <kjlu@umn.edu> wrote:
> >
> > In case alloc_workqueue fails, the fix returns -ENOMEM to avoid
> > potential NULL pointer dereference.
> >
> > Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> > ---
> > 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.
>
> > fm10k_dbg_init();
> >
> > --
> > 2.17.1
> >
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-03-26 22:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-11 6:17 [PATCH] net: fm10k: fix a potential NULL pointer dereference Kangjie Lu
2019-03-11 20:38 ` David Miller
2019-03-23 3:26 ` Kangjie Lu
2019-03-26 22:21 ` Jeff Kirsher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).