Commit 25ab898a authored by Mao Wenan's avatar Mao Wenan Committed by Kleber Sacilotto de Souza

net: set static variable an initial value in atl2_probe()

BugLink: https://bugs.launchpad.net/bugs/1822271

[ Upstream commit 4593403f ]

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: default avatarMao Wenan <maowenan@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarJuerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 6546f822
...@@ -1338,13 +1338,11 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1338,13 +1338,11 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
struct net_device *netdev; struct net_device *netdev;
struct atl2_adapter *adapter; struct atl2_adapter *adapter;
static int cards_found; static int cards_found = 0;
unsigned long mmio_start; unsigned long mmio_start;
int mmio_len; int mmio_len;
int err; int err;
cards_found = 0;
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) if (err)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment