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

* Re: [patch] qlcnic: off by one in qlcnic_init_pci_info()
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Anirban Chakraborty @ 2012-06-15  4:03 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Sony Chacko, Dept-Eng Linux Driver, netdev,
	kernel-janitors@vger.kernel.org



On 6/14/12 11:34 AM, "Dan Carpenter" <dan.carpenter@oracle.com> wrote:

>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;
> 		}

Thanks for the patch.

Acked-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>

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

* Re: [patch] qlcnic: off by one in qlcnic_init_pci_info()
  2012-06-15  4:03 ` Anirban Chakraborty
@ 2012-06-15 22:31   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2012-06-15 22:31 UTC (permalink / raw)
  To: anirban.chakraborty
  Cc: dan.carpenter, sony.chacko, Linux-Driver, netdev, kernel-janitors

From: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Date: Thu, 14 Jun 2012 21:03:14 -0700

> 
> 
> On 6/14/12 11:34 AM, "Dan Carpenter" <dan.carpenter@oracle.com> wrote:
> 
>>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>
 ...
> Acked-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>

Applied.

^ permalink raw reply	[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).