Skip to content

Commit

Permalink
qlcnic: off by one in qlcnic_init_pci_info()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Jun 15, 2012
1 parent 62b1a8a commit 0f6efff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0f6efff

Please sign in to comment.