Commit 20da637e authored by Haotian Zhang's avatar Haotian Zhang Committed by Martin K. Petersen
Browse files

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.

Fixes: 61b745fa ("scsi: stex: Add S6 support")
Signed-off-by: default avatarHaotian Zhang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20251104094847.270-1-vulab@iscas.ac.cn


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent bb8222b6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;