summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/atheros/atlx/atl2.c
diff options
context:
space:
mode:
authorMao Wenan <maowenan@huawei.com>2019-02-22 07:57:23 +0100
committerDavid S. Miller <davem@davemloft.net>2019-02-23 22:47:13 +0100
commit4593403fa516a5a4cffe6883c5062d60932cbfbe (patch)
treeea7c6861c7b594ae3ad5d1fc67109c75830f1e11 /drivers/net/ethernet/atheros/atlx/atl2.c
parentnet: phy: marvell10g: Fix Multi-G advertisement to only advertise 10G (diff)
downloadlinux-4593403fa516a5a4cffe6883c5062d60932cbfbe.tar.xz
linux-4593403fa516a5a4cffe6883c5062d60932cbfbe.zip
net: set static variable an initial value in atl2_probe()
cards_found is a static variable, but when it enters atl2_probe(), cards_found is set to zero, the value is not consistent with last probe, so next behavior is not our expect. Signed-off-by: Mao Wenan <maowenan@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/atheros/atlx/atl2.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c
index bb41becb6609..31ff1e0d1baa 100644
--- a/drivers/net/ethernet/atheros/atlx/atl2.c
+++ b/drivers/net/ethernet/atheros/atlx/atl2.c
@@ -1335,13 +1335,11 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct net_device *netdev;
struct atl2_adapter *adapter;
- static int cards_found;
+ static int cards_found = 0;
unsigned long mmio_start;
int mmio_len;
int err;
- cards_found = 0;
-
err = pci_enable_device(pdev);
if (err)
return err;