acrn-kernel/drivers/target
Yang Yingliang bc68e428d4 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: 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>
2022-11-17 17:46:16 +00:00
..
iscsi treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
loopback scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus() 2022-11-17 17:46:16 +00:00
sbp
tcm_fc
Kconfig
Makefile
target_core_alua.c scsi: target: alua: Do not report emtpy port group 2022-09-15 21:42:44 -04:00
target_core_alua.h
target_core_configfs.c
target_core_device.c scsi: target: core: UA on all LUNs after reset 2022-10-01 05:06:53 -04:00
target_core_fabric_configfs.c
target_core_fabric_lib.c
target_core_file.c
target_core_file.h
target_core_hba.c
target_core_iblock.c scsi: target: iblock: Fold iblock_emulate_read_cap_with_block_size() into iblock_get_blocks() 2022-10-01 05:51:47 -04:00
target_core_iblock.h
target_core_internal.h scsi: target: core: UA on all LUNs after reset 2022-10-01 05:06:53 -04:00
target_core_pr.c scsi: target: core: New key must be used for moved PR 2022-10-01 05:03:57 -04:00
target_core_pr.h
target_core_pscsi.c SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
target_core_pscsi.h
target_core_rd.c
target_core_rd.h
target_core_sbc.c
target_core_spc.c
target_core_stat.c
target_core_tmr.c
target_core_tpg.c
target_core_transport.c scsi: target: core: UA on all LUNs after reset 2022-10-01 05:06:53 -04:00
target_core_ua.c
target_core_ua.h
target_core_user.c
target_core_xcopy.c
target_core_xcopy.h