]> git.itanic.dy.fi Git - linux-stable/commit
3w-sas: fix command completion race
authorChristoph Hellwig <hch@lst.de>
Thu, 23 Apr 2015 07:48:49 +0000 (09:48 +0200)
committerZefan Li <lizefan@huawei.com>
Fri, 18 Sep 2015 01:20:33 +0000 (09:20 +0800)
commite456c24edd39485e1542173343e3cb53d505c612
treec37ab14b298b1e6ae669defbabf19cf1c15eb580
parent3fe48d0393d88d12a524a928d10c61cd0d446523
3w-sas: fix command completion race

commit 579d69bc1fd56d5af5761969aa529d1d1c188300 upstream.

The 3w-sas 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>
Reported-by: Torsten Luettgert <ml-lkml@enda.eu>
Tested-by: Bernd Kardatzki <Bernd.Kardatzki@med.uni-tuebingen.de>
Acked-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
drivers/scsi/3w-sas.c
drivers/scsi/3w-sas.h