Skip to content

Commit

Permalink
net: ksz884x: fix missing pci_disable_device() on error in pcidev_init()
Browse files Browse the repository at this point in the history
[ Upstream commit 5da6d65 ]

pci_disable_device() need be called while module exiting, switch to use
pcim_enable(), pci_disable_device() will be called in pcim_release()
while unbinding device.

Fixes: 8ca86fd ("net: Micrel KSZ8841/2 PCI Ethernet driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221024131338.2848959-1-yangyingliang@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yang Yingliang authored and gregkh committed Nov 3, 2022
1 parent 8927d90 commit bde7c2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/micrel/ksz884x.c
Original file line number Diff line number Diff line change
Expand Up @@ -6848,7 +6848,7 @@ static int pcidev_init(struct pci_dev *pdev, const struct pci_device_id *id)
char banner[sizeof(version)];
struct ksz_switch *sw = NULL;

result = pci_enable_device(pdev);
result = pcim_enable_device(pdev);
if (result)
return result;

Expand Down

0 comments on commit bde7c2a

Please sign in to comment.