Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 61b745fa63db ("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>

authored by

Haotian Zhang and committed by
Martin K. Petersen
20da637e bb8222b6

+1
+1
drivers/scsi/stex.c
··· 1844 1844 out_scsi_host_put: 1845 1845 scsi_host_put(host); 1846 1846 out_disable: 1847 + unregister_reboot_notifier(&stex_notifier); 1847 1848 pci_disable_device(pdev); 1848 1849 1849 1850 return err;