Skip to content

Commit

Permalink
net: set static variable an initial value in atl2_probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mao Wenan authored and David S. Miller committed Feb 23, 2019
1 parent 61a65d3 commit 4593403
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ethernet/atheros/atlx/atl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4593403

Please sign in to comment.