Skip to contentSkip to conversation

IB SRP fix for 2.6.16-rc5

GIT PULL Roland Dreier 1 participant 1 message Mar 4, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Linus, please pull from

master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git for-linus

This tree is also available from kernel.org mirrors at:

git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git for-linus

The pull will get the following change, which fixes a potential crash when a connection to an SRP storage target is lost:

Roland Dreier:
IB/srp: Don't send task management commands after target removal

 drivers/infiniband/ulp/srp/ib_srp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/infiniband/ulp/srp/ib_srp.c +6 -0
@@ -1155,6 +1155,12 @@ static int srp_send_tsk_mgmt(struct scsi
 
 	spin_lock_irq(target->scsi_host->host_lock);
 
+	if (target->state == SRP_TARGET_DEAD ||
+	    target->state == SRP_TARGET_REMOVED) {
+		scmnd->result = DID_BAD_TARGET << 16;
+		goto out;
+	}
+
 	if (scmnd->host_scribble == (void *) -1L)
 		goto out;