3w-9xxx: fix command completion race
authorChristoph Hellwig <hch@lst.de>
Thu, 23 Apr 2015 07:48:51 +0000 (09:48 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 6 Aug 2015 23:32:07 +0000 (00:32 +0100)
commitc245a412c7f135fb0a74b4c38b40f5b738ff8912
tree1e14765d91da6fec14a8b7504896e5e308f5e801
parent278b6cf917977593d14059b555f2204f8867b902
3w-9xxx: fix command completion race

commit 118c855b5623f3e2e6204f02623d88c09e0c34de upstream.

The 3w-9xxx driver needs to tear down the dma mappings before returning
the command to the midlayer, as there is no guarantee the sglist and
count are valid after that point.  Also remove the dma mapping helpers
which have another inherent race due to the request_id index.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/scsi/3w-9xxx.c
drivers/scsi/3w-9xxx.h