netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] qlcnic: off by one in qlcnic_init_pci_info()
@ 2012-06-14 18:34 Dan Carpenter
  2012-06-15  4:03 ` Anirban Chakraborty
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2012-06-14 18:34 UTC (permalink / raw)
  To: Anirban Chakraborty; +Cc: Sony Chacko, linux-driver, netdev, kernel-janitors

The adapter->npars[] array has QLCNIC_MAX_PCI_FUNC elements.  We
allocate it that way a few lines earlier in the function.  So this test
is off by one.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 33c3e46..212c121 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -479,7 +479,7 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
 
 	for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) {
 		pfn = pci_info[i].id;
-		if (pfn > QLCNIC_MAX_PCI_FUNC) {
+		if (pfn >= QLCNIC_MAX_PCI_FUNC) {
 			ret = QL_STATUS_INVALID_PARAM;
 			goto err_eswitch;
 		}

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

end of thread, other threads:[~2012-06-15 22:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14 18:34 [patch] qlcnic: off by one in qlcnic_init_pci_info() Dan Carpenter
2012-06-15  4:03 ` Anirban Chakraborty
2012-06-15 22:31   ` David Miller

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).