All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] qlge: pull NULL check ahead of dereference
@ 2010-08-19 10:02 ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2010-08-19 10:02 UTC (permalink / raw)
  To: Ron Mercer
  Cc: linux-driver, David S. Miller, Breno Leitao, netdev,
	kernel-janitors, ron.mercer

There was a dereference before NULL check issue introduced in 1e213303d
"qlge: Add tx multiqueue support."  I've pulled the NULL check of
"net_rsp" forward a couple lines to restore the original semantics.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 8d63f69..611fba4 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -2223,9 +2223,12 @@ static int ql_clean_outbound_rx_ring(struct rx_ring *rx_ring)
 		prod = ql_read_sh_reg(rx_ring->prod_idx_sh_reg);
 	}
 	ql_write_cq_idx(rx_ring);
+
+	if (!net_rsp)
+		return 0;
+
 	tx_ring = &qdev->tx_ring[net_rsp->txq_idx];
-	if (__netif_subqueue_stopped(qdev->ndev, tx_ring->wq_id) &&
-					net_rsp != NULL) {
+	if (__netif_subqueue_stopped(qdev->ndev, tx_ring->wq_id)) {
 		if (atomic_read(&tx_ring->queue_stopped) &&
 		    (atomic_read(&tx_ring->tx_count) > (tx_ring->wq_len / 4)))
 			/*

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

end of thread, other threads:[~2010-08-20  3:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-19 10:02 [patch] qlge: pull NULL check ahead of dereference Dan Carpenter
2010-08-19 10:02 ` Dan Carpenter
2010-08-19 12:19 ` Ron Mercer
2010-08-19 12:19   ` Ron Mercer
2010-08-19 12:59   ` Ron Mercer
2010-08-19 12:59     ` Ron Mercer
2010-08-19 18:52     ` [patch v2] " Dan Carpenter
2010-08-19 18:52       ` Dan Carpenter
2010-08-19 20:28       ` Ron Mercer
2010-08-19 20:28         ` Ron Mercer
2010-08-20  3:48         ` David Miller
2010-08-20  3:48           ` 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.