3w-xxxx: fix command completion race
authorChristoph Hellwig <hch@lst.de>
Thu, 23 Apr 2015 07:48:50 +0000 (09:48 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 6 Aug 2015 23:32:07 +0000 (00:32 +0100)
commit278b6cf917977593d14059b555f2204f8867b902
tree832db352feef4d010bc543c8a58d38c77a48cf39
parent4fcafc95800aaa813435f5b9038182ca03dc6280
3w-xxxx: fix command completion race

commit 9cd9554615cba14f0877cc9972a6537ad2bdde61 upstream.

The 3w-xxxx 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-xxxx.c
drivers/scsi/3w-xxxx.h