3w-xxxx: fix command completion race

commit 9cd9554615 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: Luis Henriques <luis.henriques@canonical.com>
This commit is contained in:
Christoph Hellwig 2015-04-23 09:48:50 +02:00 • committed by Luis Henriques
commit 02a8bc2d70
2 changed files with 6 additions and 41 deletions