Skip to content

Commit 8616943

Browse files
ISCAS-Vulabgregkh
authored andcommitted
scsi: stex: Fix reboot_notifier leak in probe error path
[ Upstream commit 20da637 ] 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. Fixes: 61b745f ("scsi: stex: Add S6 support") Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Link: https://patch.msgid.link/20251104094847.270-1-vulab@iscas.ac.cn Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6b69593 commit 8616943

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/scsi/stex.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,6 +1844,7 @@ static int stex_probe(struct pci_dev *pdev, const struct pci_device_id *id)
18441844
out_scsi_host_put:
18451845
scsi_host_put(host);
18461846
out_disable:
1847+
unregister_reboot_notifier(&stex_notifier);
18471848
pci_disable_device(pdev);
18481849

18491850
return err;

0 commit comments

Comments
 (0)