Skip to content

Commit 4593403

Browse files
Mao Wenandavem330
authored andcommitted
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>
1 parent 61a65d3 commit 4593403

File tree

1 file changed

+1
-3
lines changed
  • drivers/net/ethernet/atheros/atlx

1 file changed

+1
-3
lines changed

drivers/net/ethernet/atheros/atlx/atl2.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,13 +1335,11 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
13351335
{
13361336
struct net_device *netdev;
13371337
struct atl2_adapter *adapter;
1338-
static int cards_found;
1338+
static int cards_found = 0;
13391339
unsigned long mmio_start;
13401340
int mmio_len;
13411341
int err;
13421342

1343-
cards_found = 0;
1344-
13451343
err = pci_enable_device(pdev);
13461344
if (err)
13471345
return err;

0 commit comments

Comments
 (0)