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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Apr 2012 16:18:16 +0000 (09:18 -0700)
commit0d05568ac79bfc595f1eadc3e0fd7a20a45f7b69
treed15134080908344c9518d936b98a31f511aa4892
parent4ca5218e3939685c2325fc0a0a1ac8150272c93f
staging:rts_pstor:Fix possible panic by NULL pointer dereference

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>
drivers/staging/rts_pstor/rtsx_transport.c