@@ -1940,7 +1940,8 @@ static void de21041_get_srom_info(struct de_private *de)
de->media[i].csr15 = t21041_csr15[i];
}
- de->ee_data = kmemdup(&ee_data[0], DE_EEPROM_SIZE, GFP_KERNEL);
+ de->ee_data = devm_kmemdup(&de->pdev->dev, &ee_data[0], DE_EEPROM_SIZE,
+ GFP_KERNEL);
return;
@@ -2092,7 +2093,6 @@ static int de_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0;
err_out_iomap:
- kfree(de->ee_data);
iounmap(regs);
err_out_res:
pci_release_regions(pdev);
@@ -2106,7 +2106,6 @@ static void de_remove_one(struct pci_dev *pdev)
BUG_ON(!dev);
unregister_netdev(dev);
- kfree(de->ee_data);
iounmap(de->regs);
pci_release_regions(pdev);
}
Replace an instance of kmemdup() with the devres counted version instead. Signed-off-by: Moritz Fischer <mdf@kernel.org> --- drivers/net/ethernet/dec/tulip/de2104x.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)