mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
ionic: Fix netdev notifier unregister on failure
If register_netdev() fails, then the driver leaks the netdev notifier.
Fix this by calling ionic_lif_unregister() on register_netdev()
failure. This will also call ionic_lif_unregister_phc() if it has
already been registered.
Fixes: 30b87ab4c0
("ionic: remove lif list concept")
Signed-off-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20241212213157.12212-2-shannon.nelson@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
663ad7481f
commit
9590d32e09
@ -3869,8 +3869,8 @@ int ionic_lif_register(struct ionic_lif *lif)
|
|||||||
/* only register LIF0 for now */
|
/* only register LIF0 for now */
|
||||||
err = register_netdev(lif->netdev);
|
err = register_netdev(lif->netdev);
|
||||||
if (err) {
|
if (err) {
|
||||||
dev_err(lif->ionic->dev, "Cannot register net device, aborting\n");
|
dev_err(lif->ionic->dev, "Cannot register net device: %d, aborting\n", err);
|
||||||
ionic_lif_unregister_phc(lif);
|
ionic_lif_unregister(lif);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user