Commit b85aeb51 authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by John W. Linville

adm8211: fix memory leak

We must free priv->eeprom allocated in adm8211_read_eeprom().
Signed-off-by: default avatarKulikov Vasiliy <segooon@gmail.com>
Acked-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4c92831d
...@@ -1903,7 +1903,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev, ...@@ -1903,7 +1903,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
if (err) { if (err) {
printk(KERN_ERR "%s (adm8211): Cannot register device\n", printk(KERN_ERR "%s (adm8211): Cannot register device\n",
pci_name(pdev)); pci_name(pdev));
goto err_free_desc; goto err_free_eeprom;
} }
printk(KERN_INFO "%s: hwaddr %pM, Rev 0x%02x\n", printk(KERN_INFO "%s: hwaddr %pM, Rev 0x%02x\n",
...@@ -1912,6 +1912,9 @@ static int __devinit adm8211_probe(struct pci_dev *pdev, ...@@ -1912,6 +1912,9 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
return 0; return 0;
err_free_eeprom:
kfree(priv->eeprom);
err_free_desc: err_free_desc:
pci_free_consistent(pdev, pci_free_consistent(pdev,
sizeof(struct adm8211_desc) * priv->rx_ring_size + sizeof(struct adm8211_desc) * priv->rx_ring_size +
......
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