IB/srp: Fix a race condition
authorBart Van Assche <bvanassche@acm.org>
Tue, 14 Aug 2012 13:18:53 +0000 (13:18 +0000)
committerRoland Dreier <roland@purestorage.com>
Wed, 15 Aug 2012 19:00:48 +0000 (12:00 -0700)
commit220329916c72ee3d54ae7262b215a050f04a18fc
tree0d89f6e3cc8f17b070c16665d3df4e883fda9ddc
parent0d7614f09c1ebdbaa1599a5aba7593f147bf96ee
IB/srp: Fix a race condition

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
Cc: <stable@vger.kernel.org>
Acked-by: David Dillow <dillowda@ornl.gov>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/ulp/srp/ib_srp.c