3w-xxxx: fix command completion race
authorChristoph Hellwig <hch@lst.de>
Thu, 23 Apr 2015 07:48:50 +0000 (09:48 +0200)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 17 May 2015 23:12:41 +0000 (19:12 -0400)
commitc0abe5a7b642a140c90211fc68eaa4f84adc9603
tree302c232131f6ccbdeae8f1024a1486b71b7d2b7e
parente5975e422e51281bcaea4c98f954a70916f58906
3w-xxxx: fix command completion race

[ Upstream commit 9cd9554615cba14f0877cc9972a6537ad2bdde61 ]

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>
Cc: stable@vger.kernel.org
Acked-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/scsi/3w-xxxx.c
drivers/scsi/3w-xxxx.h