linux-stable/drivers/target
Yang Yingliang dce0589a3f scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus()
[ Upstream commit bc68e428d4 ]

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: 3703b2c5d0 ("[SCSI] tcm_loop: Add multi-fabric Linux/SCSI LLD fabric module")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221115015042.3652261-1-yangyingliang@huawei.com
Reviewed-by: Mike Christie <michael.chritie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-26 09:27:53 +01:00
..
iscsi scsi: target: iscsi: Do not require target authentication 2022-07-26 22:13:29 -04:00
loopback scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus() 2022-11-26 09:27:53 +01:00
sbp
tcm_fc
Kconfig
Makefile
target_core_alua.c scsi: target: core: De-RCU of se_lun and se_lun acl 2022-08-01 19:36:02 -04:00
target_core_alua.h
target_core_configfs.c scsi: target: Detect UNMAP support post configuration 2022-07-07 16:53:53 -04:00
target_core_device.c scsi: target: core: De-RCU of se_lun and se_lun acl 2022-08-01 19:36:02 -04:00
target_core_fabric_configfs.c
target_core_fabric_lib.c
target_core_file.c SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
target_core_file.h
target_core_hba.c
target_core_iblock.c SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
target_core_iblock.h
target_core_internal.h
target_core_pr.c scsi: target: core: De-RCU of se_lun and se_lun acl 2022-08-01 19:36:02 -04:00
target_core_pr.h
target_core_pscsi.c blk-mq: remove the done argument to blk_execute_rq_nowait 2022-05-28 06:15:27 -06:00
target_core_pscsi.h
target_core_rd.c
target_core_rd.h
target_core_sbc.c SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
target_core_spc.c
target_core_stat.c scsi: target: core: De-RCU of se_lun and se_lun acl 2022-08-01 19:36:02 -04:00
target_core_tmr.c
target_core_tpg.c
target_core_transport.c
target_core_ua.c
target_core_ua.h
target_core_user.c
target_core_xcopy.c scsi: target: core: De-RCU of se_lun and se_lun acl 2022-08-01 19:36:02 -04:00
target_core_xcopy.h