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 22:12:13 +0000 (15:12 -0700)
commit15e892b321f5669a48fbdfa3e9608ef1b185f8d8
tree0b502534c30195b241cf491913c917ef5ace7d1d
parent3a933fe49eaf78889e5cfb4faef6dd3f31d4b423
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