Skip to content

Commit a861790

Browse files
zoumingzhemartinkpetersen
authored andcommitted
scsi: target: iscsi: Make sure the np under each tpg is unique
iscsit_tpg_check_network_portal() has nested for_each loops and is supposed to return true when a match is found. However, the tpg loop will still continue after existing the tpg_np loop. If this tpg_np is not the last the match value will be changed. Break the outer loop after finding a match and make sure the np under each tpg is unique. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: ZouMingzhe <[email protected]> Reviewed-by: Mike Christie <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 61263b3 commit a861790

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/target/iscsi/iscsi_target_tpg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,9 @@ static bool iscsit_tpg_check_network_portal(
443443
break;
444444
}
445445
spin_unlock(&tpg->tpg_np_lock);
446+
447+
if (match)
448+
break;
446449
}
447450
spin_unlock(&tiqn->tiqn_tpg_lock);
448451

0 commit comments

Comments
 (0)