Commit 5b4fb1d
committed
scsi: iscsi: Fix missing scsi_host_put() in error path
JIRA: https://issues.redhat.com/browse/RHEL-90552
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: ce51c81 ("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>
(cherry picked from commit 72eea84)
Signed-off-by: Chris Leech <cleech@redhat.com>1 parent b2b1d52 commit 5b4fb1d
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3182 | 3182 | | |
3183 | 3183 | | |
3184 | 3184 | | |
3185 | | - | |
3186 | | - | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
3187 | 3189 | | |
3188 | 3190 | | |
3189 | 3191 | | |
| 3192 | + | |
3190 | 3193 | | |
3191 | 3194 | | |
3192 | 3195 | | |
| |||
0 commit comments