All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] ixgbevf: potential NULL dereference on allocation failure
@ 2010-09-10 11:52 ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2010-09-10 11:52 UTC (permalink / raw)
  To: Greg Rose; +Cc: David S. Miller, Jeff Kirsher, netdev, kernel-janitors

If "rx_ring" is NULL then it will oops when we try:

	memcpy(rx_ring, adapter->rx_ring,
		adapter->num_rx_queues * sizeof(struct ixgbevf_ring));

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
To be honest, I'm not sure why the check for need_tx_update is there.
This change has only been compile tested.

diff --git a/drivers/net/ixgbevf/ethtool.c b/drivers/net/ixgbevf/ethtool.c
index 4680b06..7f194aa 100644
--- a/drivers/net/ixgbevf/ethtool.c
+++ b/drivers/net/ixgbevf/ethtool.c
@@ -385,7 +385,7 @@ static int ixgbevf_set_ringparam(struct net_device *netdev,
 	if (new_rx_count != adapter->rx_ring_count) {
 		rx_ring = kcalloc(adapter->num_rx_queues,
 				  sizeof(struct ixgbevf_ring), GFP_KERNEL);
-		if ((!rx_ring) && (need_tx_update)) {
+		if (!rx_ring) {
 			err = -ENOMEM;
 			goto err_rx_setup;
 		}

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

end of thread, other threads:[~2010-09-19 18:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-10 11:52 [patch] ixgbevf: potential NULL dereference on allocation failure Dan Carpenter
2010-09-10 11:52 ` Dan Carpenter
2010-09-10 20:21 ` [patch] ixgbevf: potential NULL dereference on allocation David Miller
2010-09-10 20:21   ` [patch] ixgbevf: potential NULL dereference on allocation failure David Miller
2010-09-10 20:25   ` [patch] ixgbevf: potential NULL dereference on allocation Rose, Gregory V
2010-09-10 20:25     ` [patch] ixgbevf: potential NULL dereference on allocation failure Rose, Gregory V
2010-09-14 16:57   ` [patch] ixgbevf: potential NULL dereference on allocation Rose, Gregory V
2010-09-14 16:57     ` [patch] ixgbevf: potential NULL dereference on allocation failure Rose, Gregory V
2010-09-19 18:33     ` [patch] ixgbevf: potential NULL dereference on allocation David Miller
2010-09-19 18:33       ` [patch] ixgbevf: potential NULL dereference on allocation failure 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.