IB/srp: Fix a race condition
authorBart Van Assche <bvanassche@acm.org>
Tue, 14 Aug 2012 13:18:53 +0000 (13:18 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 12 Sep 2012 02:37:04 +0000 (03:37 +0100)
commitfc7834af1b974a2578440d1210a991eedd2151b1
tree5c09f7d43cb74de56c01a94030f5f7c4ad95327c
parente18b3cbd16e4d5f77f9b9138ab143b2d10db88fe
IB/srp: Fix a race condition

commit 220329916c72ee3d54ae7262b215a050f04a18fc upstream.

Avoid a crash caused by the scmnd->scsi_done(scmnd) call in
srp_process_rsp() being invoked with scsi_done == NULL.  This can
happen if a reply is received during or after a command abort.

Reported-by: Joseph Glanville <joseph.glanville@orionvm.com.au>
Reference: http://marc.info/?l=linux-rdma&m=134314367801595
Acked-by: David Dillow <dillowda@ornl.gov>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/infiniband/ulp/srp/ib_srp.c