]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: iscsi: Fix missing scsi_host_put() in error path
authorMiaoqian Lin <linmq006@gmail.com>
Tue, 18 Mar 2025 09:43:43 +0000 (17:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:39:18 +0000 (07:39 +0200)
commit68558f83a3e94c81b8a1fbbd290ebff81f54c93c
tree7eeae9bfa6f70c38d1d99b0e53554bf9a6416917
parent13c9744c1bcdb5de4e7dc1a78784788ecec52add
scsi: iscsi: Fix missing scsi_host_put() in error path

[ Upstream commit 72eea84a1092b50a10eeecfeba4b28ac9f1312ab ]

Add goto to ensure scsi_host_put() is called in all error paths of
iscsi_set_host_param() function. This fixes a potential memory leak when
strlen() check fails.

Fixes: ce51c8170084 ("scsi: iscsi: Add strlen() check in iscsi_if_set{_host}_param()")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20250318094344.91776-1-linmq006@gmail.com
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/scsi_transport_iscsi.c