diff options
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 2d2d4ac3525a..960dae5c87d1 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -1155,6 +1155,12 @@ static int srp_send_tsk_mgmt(struct scsi_cmnd *scmnd, u8 func) | |||
1155 | 1155 | ||
1156 | spin_lock_irq(target->scsi_host->host_lock); | 1156 | spin_lock_irq(target->scsi_host->host_lock); |
1157 | 1157 | ||
1158 | if (target->state == SRP_TARGET_DEAD || | ||
1159 | target->state == SRP_TARGET_REMOVED) { | ||
1160 | scmnd->result = DID_BAD_TARGET << 16; | ||
1161 | goto out; | ||
1162 | } | ||
1163 | |||
1158 | if (scmnd->host_scribble == (void *) -1L) | 1164 | if (scmnd->host_scribble == (void *) -1L) |
1159 | goto out; | 1165 | goto out; |
1160 | 1166 | ||