IB/srp: Fix a race condition
authorBart Van Assche <bvanassche@acm.org>
Tue, 14 Aug 2012 13:18:53 +0000 (13:18 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 26 Aug 2012 02:31:45 +0000 (19:31 -0700)
commit16ff8d53da93e20c57e88067a254d3106b7aed5f
tree019b56e40eb97d87942cfaa63ea2c4ada9ef2c77
parent09e0ef11ee0328f1f3c9c47c15347c867994dd9b
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/ulp/srp/ib_srp.c