]> git.karo-electronics.de Git - karo-tx-linux.git/commit
staging:rts_pstor:Fix possible panic by NULL pointer dereference
authorwwang <wei_wang@realsil.com.cn>
Tue, 27 Mar 2012 08:43:11 +0000 (16:43 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 4 Jul 2012 04:44:14 +0000 (05:44 +0100)
commitc4a08668a15a03370b3ba7cae49d1017f2c8434d
tree018adb999d08ed3ea3f6b7ecd2912b3756c72401
parent86d94bc5ca0b9283cae6dfa34b259d22200b4e3a
staging:rts_pstor:Fix possible panic by NULL pointer dereference

commit 0d05568ac79bfc595f1eadc3e0fd7a20a45f7b69 upstream.

rtsx_transport.c (rtsx_transfer_sglist_adma_partial):
pointer struct scatterlist *sg, which is mapped in dma_map_sg,
is used as an iterator in later transfer operation. It is corrupted and
passed to dma_unmap_sg, thus causing fatal unmap of some erroneous address.
Fix it by duplicating *sg_ptr for iterating.

Signed-off-by: wwang <wei_wang@realsil.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/staging/rts_pstor/rtsx_transport.c