Skip to content

Commit 1d99702

Browse files
Wu Bomartinkpetersen
authored andcommitted
scsi: libiscsi: Fix error count for active session
Fix an error count for active session if the total_cmds is invalid on the function iscsi_session_setup(). Decrement the number of active sessions before the funcion return. Link: https://lore.kernel.org/r/EDBAAA0BBBA2AC4E9C8B6B81DEEE1D6916A28542@DGGEML525-MBS.china.huawei.com Reviewed-by: Lee Duncan <[email protected]> Signed-off-by: Wu Bo <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 3e16e83 commit 1d99702

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/libiscsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2771,7 +2771,7 @@ iscsi_session_setup(struct iscsi_transport *iscsit, struct Scsi_Host *shost,
27712771
"must be a power of 2.\n", total_cmds);
27722772
total_cmds = rounddown_pow_of_two(total_cmds);
27732773
if (total_cmds < ISCSI_TOTAL_CMDS_MIN)
2774-
return NULL;
2774+
goto dec_session_count;
27752775
printk(KERN_INFO "iscsi: Rounding can_queue to %d.\n",
27762776
total_cmds);
27772777
}

0 commit comments

Comments
 (0)