All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: thunder: fix a potential NULL pointer dereference
@ 2019-03-11  6:05 ` Kangjie Lu
  0 siblings, 0 replies; 4+ messages in thread
From: Kangjie Lu @ 2019-03-11  6:05 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Sunil Goutham, Robert Richter, David S. Miller,
	linux-arm-kernel, netdev, linux-kernel

In case alloc_ordered_workqueue fails, the fix reports the error
and returns -ENOMEM.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 drivers/net/ethernet/cavium/thunder/nicvf_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
index 503cfadff4ac..aa2be4807191 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@ -2234,6 +2234,12 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	nic->nicvf_rx_mode_wq = alloc_ordered_workqueue("nicvf_rx_mode_wq_VF%d",
 							WQ_MEM_RECLAIM,
 							nic->vf_id);
+	if (!nic->nicvf_rx_mode_wq) {
+		err = -ENOMEM;
+		dev_err(dev, "Failed to allocate work queue\n");
+		goto err_unregister_interrupts;
+	}
+
 	INIT_WORK(&nic->rx_mode_work.work, nicvf_set_rx_mode_task);
 	spin_lock_init(&nic->rx_mode_wq_lock);
 	mutex_init(&nic->rx_mode_mtx);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] net: thunder: fix a potential NULL pointer dereference
@ 2019-03-11  6:05 ` Kangjie Lu
  0 siblings, 0 replies; 4+ messages in thread
From: Kangjie Lu @ 2019-03-11  6:05 UTC (permalink / raw)
  To: kjlu
  Cc: Robert Richter, netdev, linux-kernel, pakki001, Sunil Goutham,
	David S. Miller, linux-arm-kernel

In case alloc_ordered_workqueue fails, the fix reports the error
and returns -ENOMEM.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 drivers/net/ethernet/cavium/thunder/nicvf_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
index 503cfadff4ac..aa2be4807191 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@ -2234,6 +2234,12 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	nic->nicvf_rx_mode_wq = alloc_ordered_workqueue("nicvf_rx_mode_wq_VF%d",
 							WQ_MEM_RECLAIM,
 							nic->vf_id);
+	if (!nic->nicvf_rx_mode_wq) {
+		err = -ENOMEM;
+		dev_err(dev, "Failed to allocate work queue\n");
+		goto err_unregister_interrupts;
+	}
+
 	INIT_WORK(&nic->rx_mode_work.work, nicvf_set_rx_mode_task);
 	spin_lock_init(&nic->rx_mode_wq_lock);
 	mutex_init(&nic->rx_mode_mtx);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: thunder: fix a potential NULL pointer dereference
  2019-03-11  6:05 ` Kangjie Lu
@ 2019-03-11 20:34   ` David Miller
  -1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-03-11 20:34 UTC (permalink / raw)
  To: kjlu; +Cc: pakki001, sgoutham, rric, linux-arm-kernel, netdev, linux-kernel

From: Kangjie Lu <kjlu@umn.edu>
Date: Mon, 11 Mar 2019 01:05:41 -0500

> In case alloc_ordered_workqueue fails, the fix reports the error
> and returns -ENOMEM.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: thunder: fix a potential NULL pointer dereference
@ 2019-03-11 20:34   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-03-11 20:34 UTC (permalink / raw)
  To: kjlu; +Cc: rric, netdev, linux-kernel, pakki001, sgoutham, linux-arm-kernel

From: Kangjie Lu <kjlu@umn.edu>
Date: Mon, 11 Mar 2019 01:05:41 -0500

> In case alloc_ordered_workqueue fails, the fix reports the error
> and returns -ENOMEM.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>

Applied.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-11 20:35 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:05 [PATCH] net: thunder: fix a potential NULL pointer dereference Kangjie Lu
2019-03-11  6:05 ` Kangjie Lu
2019-03-11 20:34 ` David Miller
2019-03-11 20:34   ` 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.