--- /dev/null
+From stable-bounces@linux.kernel.org Mon Mar 6 20:28:25 2006
+Date: Mon, 06 Mar 2006 20:23:33 -0800
+From: Roland Dreier <rdreier@cisco.com>
+To: stable@kernel.org
+Cc:
+Subject: [PATCH] IB/srp: Don't send task management commands after target removal
+
+Just fail abort and reset requests that come in after we've already
+decided to remove a target. This fixes a nasty crash if a storage
+target goes away.
+
+Signed-off-by: Roland Dreier <rolandd@cisco.com>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+
+This is upstream in Linus's tree as 1285b3a0b0aa2391ac6f6939e6737203c8220f68
+
+ drivers/infiniband/ulp/srp/ib_srp.c | 6 ++++++
+ 1 files changed, 6 insertions(+)
+
+--- linux-2.6.15.6.orig/drivers/infiniband/ulp/srp/ib_srp.c
++++ linux-2.6.15.6/drivers/infiniband/ulp/srp/ib_srp.c
+@@ -1154,6 +1154,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;
+