aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-mod.c
diff options
context:
space:
mode:
authorYang Yingliang <[email protected]>2022-11-15 09:50:42 +0800
committerMartin K. Petersen <[email protected]>2022-11-17 17:46:16 +0000
commitbc68e428d4963af0201e92159629ab96948f0893 (patch)
tree4cc39ca754d03de7b6c6cd62df1a29eaf4bc6a8c /lib/mpi/mpi-mod.c
parent7d21fcfb409500dc9b114567f0ef8d30b3190dee (diff)
scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus()
If device_register() fails in tcm_loop_setup_hba_bus(), the name allocated by dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup(). The 'tl_hba' will be freed in tcm_loop_release_adapter(), so it don't need goto error label in this case. Fixes: 3703b2c5d041 ("[SCSI] tcm_loop: Add multi-fabric Linux/SCSI LLD fabric module") Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Mike Christie <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-mod.c')
0 files changed, 0 insertions, 0 deletions