diff options
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 28d741e7805c..7c0a3d9c9056 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -1867,8 +1867,7 @@ static void srp_remove_one(struct ib_device *device) | |||
1867 | * commands and don't try to reconnect. | 1867 | * commands and don't try to reconnect. |
1868 | */ | 1868 | */ |
1869 | mutex_lock(&host->target_mutex); | 1869 | mutex_lock(&host->target_mutex); |
1870 | list_for_each_entry_safe(target, tmp_target, | 1870 | list_for_each_entry(target, &host->target_list, list) { |
1871 | &host->target_list, list) { | ||
1872 | spin_lock_irqsave(target->scsi_host->host_lock, flags); | 1871 | spin_lock_irqsave(target->scsi_host->host_lock, flags); |
1873 | if (target->state != SRP_TARGET_REMOVED) | 1872 | if (target->state != SRP_TARGET_REMOVED) |
1874 | target->state = SRP_TARGET_REMOVED; | 1873 | target->state = SRP_TARGET_REMOVED; |