scsi: stex: fix reboot_notifier leak in probe error path
PATCH 1/1 scsi: stex: fix reboot_notifier leak in probe error path
In stex_probe(), register_reboot_notifier() is called at the beginning, but if any subsequent initialization step fails, the function returns without unregistering the notifier, resulting in a resource leak.
Add unregister_reboot_notifier() in the out_disable error path to ensure proper cleanup on all failure paths.
--- drivers/scsi/stex.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/stex.c +1 -0
@@ -1844,6 +1844,7 @@ static int stex_probe(struct pci_dev *pdev, const struct pci_device_id *id) out_scsi_host_put:scsi_host_put (host); out_disable: +unregister_reboot_notifier (&stex_notifier);pci_disable_device (pdev);return err;
Signature · 1 line
2.50.1.windows.1
Martin K. Petersen
AppliedHaotian,
Quoted 4 lines
In
stex_probe(),register_reboot_notifier()is called at the beginning, but if any subsequent initialization step fails, the function returns without unregistering the notifier, resulting in a resource leak.
Applied to 6.19/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen
Martin K. Petersen
AppliedQuoted 8 lines · Haotian Zhang
In
stex_probe(),register_reboot_notifier()is called at the beginning, but if any subsequent initialization step fails, the function returns without unregistering the notifier, resulting in a resource leak.Add
unregister_reboot_notifier()in theout_disableerror path to ensure proper cleanup on all failure paths.[...]
Applied to 6.19/scsi-queue, thanks!
[1/1] scsi: stex: fix reboot_notifier leak in probe error path
https://git.kernel.org/mkp/scsi/c/20da637eb545
Signature · 1 line
Martin K. Petersen