Commit b5de4a22 authored by Ying Xue's avatar Ying Xue Committed by David S. Miller

atm: idt77252: fix dev refcnt leak

init_card() calls dev_get_by_name() to get a network deceive. But it
doesn't decrease network device reference count after the device is
used.
Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 236c9f84
...@@ -3511,7 +3511,7 @@ static int init_card(struct atm_dev *dev) ...@@ -3511,7 +3511,7 @@ static int init_card(struct atm_dev *dev)
tmp = dev_get_by_name(&init_net, tname); /* jhs: was "tmp = dev_get(tname);" */ tmp = dev_get_by_name(&init_net, tname); /* jhs: was "tmp = dev_get(tname);" */
if (tmp) { if (tmp) {
memcpy(card->atmdev->esi, tmp->dev_addr, 6); memcpy(card->atmdev->esi, tmp->dev_addr, 6);
dev_put(tmp);
printk("%s: ESI %pM\n", card->name, card->atmdev->esi); printk("%s: ESI %pM\n", card->name, card->atmdev->esi);
} }
/* /*
......
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