]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: mediatek - fix incorrect data transfer result
authorRyder Lee <ryder.lee@mediatek.com>
Fri, 20 Jan 2017 05:41:09 +0000 (13:41 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 23 Jan 2017 14:50:29 +0000 (22:50 +0800)
commit1365f7b16be5c7e4cecd5dd48ef8e1bd3c143d05
tree5fb79adb5e88a5825f825f5043761b3ac16df390
parentb3d2987d61bfb208417848296aac8452a14bf502
crypto: mediatek - fix incorrect data transfer result

This patch fixes mtk_aes_xmit() data transfer bug.

The original function uses the same loop and ring->pos
to handle both command and result descriptors. But this
produces incomplete results when src.sg_len != dst.sg_len.

To solve the problem, we splits the descriptors into different
loops and uses cmd_pos and res_pos to record them respectively.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/mediatek/mtk-aes.c
drivers/crypto/mediatek/mtk-platform.h
drivers/crypto/mediatek/mtk-sha.c