]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
enic: fix compile when CONFIG_PCI_IOV is not enabled
authorRoopa Prabhu <roprabhu@cisco.com>
Thu, 19 Jan 2012 22:25:36 +0000 (22:25 +0000)
committerJoe Jin <joe.jin@oracle.com>
Wed, 29 Aug 2012 00:22:10 +0000 (08:22 +0800)
reverting back change that access enic->num_vfs outside
CONFIG_PCI_IOV

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
(cherry picked from commit b67f231ded332461dd31123c4f659c4681223fb1)
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/enic/enic_main.c

index ea1643806ef04328e41fe9eb2ffa723ef4f44427..e620128a450dfcc3699f29d694f9a8cc5082b60c 100644 (file)
@@ -2279,7 +2279,7 @@ static int __devinit enic_probe(struct pci_dev *pdev,
 #ifdef CONFIG_PCI_IOV
        int pos = 0;
 #endif
-       int num_pps;
+       int num_pps = 1;
 
        /* Allocate net device structure and initialize.  Private
         * instance data is initialized to zero.
@@ -2386,11 +2386,11 @@ static int __devinit enic_probe(struct pci_dev *pdev,
                                goto err_out_vnic_unregister;
                        }
                        enic->priv_flags |= ENIC_SRIOV_ENABLED;
+                       num_pps = enic->num_vfs;
                }
        }
 #endif
 
-       num_pps = enic->num_vfs ? enic->num_vfs : 1;
        /* Allocate structure for port profiles */
        enic->pp = kcalloc(num_pps, sizeof(*enic->pp), GFP_KERNEL);
        if (!enic->pp) {