From: Dan Carpenter <error27@gmail.com>
To: Ron Mercer <ron.mercer@qlogic.com>
Cc: linux-driver@qlogic.com, "David S. Miller" <davem@davemloft.net>,
Breno Leitao <leitao@linux.vnet.ibm.com>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org,
ron.mercer@qlogic.com
Subject: [patch] qlge: pull NULL check ahead of dereference
Date: Thu, 19 Aug 2010 12:02:15 +0200 [thread overview]
Message-ID: <20100819100214.GB6674@bicker> (raw)
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)))
/*
next reply other threads:[~2010-08-19 10:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-19 10:02 Dan Carpenter [this message]
2010-08-19 12:19 ` [patch] qlge: pull NULL check ahead of dereference Ron Mercer
2010-08-19 12:59 ` Ron Mercer
2010-08-19 18:52 ` [patch v2] " Dan Carpenter
2010-08-19 20:28 ` Ron Mercer
2010-08-20 3:48 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100819100214.GB6674@bicker \
--to=error27@gmail.com \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=leitao@linux.vnet.ibm.com \
--cc=linux-driver@qlogic.com \
--cc=netdev@vger.kernel.org \
--cc=ron.mercer@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).