mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 05:27:07 +02:00
net: thunderx: Fix missing destroy_workqueue of nicvf_rx_mode_wq
[ Upstream commit42330a3293] The nicvf_probe() won't destroy workqueue when register_netdev() failed. Add destroy_workqueue err handle case to fix this issue. Fixes:2ecbe4f4a0("net: thunderx: replace global nicvf_rx_mode_wq work queue for all VFs to private for each of them.") Signed-off-by: Yongqiang Liu <liuyongqiang13@huawei.com> Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Link: https://lore.kernel.org/r/20221203094125.602812-1-liuyongqiang13@huawei.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a5cfbc1995
commit
8d1aed7a11
|
|
@ -2258,7 +2258,7 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
err = register_netdev(netdev);
|
err = register_netdev(netdev);
|
||||||
if (err) {
|
if (err) {
|
||||||
dev_err(dev, "Failed to register netdevice\n");
|
dev_err(dev, "Failed to register netdevice\n");
|
||||||
goto err_unregister_interrupts;
|
goto err_destroy_workqueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
nic->msg_enable = debug;
|
nic->msg_enable = debug;
|
||||||
|
|
@ -2267,6 +2267,8 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
err_destroy_workqueue:
|
||||||
|
destroy_workqueue(nic->nicvf_rx_mode_wq);
|
||||||
err_unregister_interrupts:
|
err_unregister_interrupts:
|
||||||
nicvf_unregister_interrupts(nic);
|
nicvf_unregister_interrupts(nic);
|
||||||
err_free_netdev:
|
err_free_netdev:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user