netxen: unregister notifiers if PCI registration fails

netxen_init_module() registers the netdevice and inetaddr notifiers before
registering the PCI driver.  If pci_register_driver() fails, the function
returns the error directly and leaves both notifiers registered.

That leaves notifier callbacks installed for a module that failed to load.
Mirror the module exit path on this failure and unregister the notifiers
before returning the error.

Cc: stable+noautosel@kernel.org # untested fix to unlikely driver error path
Signed-off-by: Can Peng <pengcan@kylinos.cn>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20260728032046.121631-2-pengcan@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Can Peng 2026-07-28 11:20:45 +08:00 • committed by Jakub Kicinski
commit e8aaf6ba33