summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@benyossef.com>2017-06-06 11:00:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-06 16:23:27 +0200
commit26f4b1f7a8da3eaa6c32e12f87c9f5388196dc67 (patch)
tree637f4262243277e6367556f42874008b89931d89 /drivers/staging
parent0a33252e060e97ed3fbdcec9517672f1e91aaef3 (diff)
downloadlinux-26f4b1f7a8da3eaa6c32e12f87c9f5388196dc67.tar.gz
linux-26f4b1f7a8da3eaa6c32e12f87c9f5388196dc67.tar.bz2
linux-26f4b1f7a8da3eaa6c32e12f87c9f5388196dc67.zip
staging: ccree: fix buffer copy
Fix a bug where the copying of scatterlist buffers incorrectly ignored bytes to skip in a scatterlist and ended 1 byte short. This fixes testmgr hmac and hash test failures currently obscured by hash import/export not being supported. Fixes: abefd6741d ("staging: ccree: introduce CryptoCell HW driver"). Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/ccree/ssi_buffer_mgr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c
index 038e2ff5e545..6471d3d2d375 100644
--- a/drivers/staging/ccree/ssi_buffer_mgr.c
+++ b/drivers/staging/ccree/ssi_buffer_mgr.c
@@ -216,7 +216,8 @@ void ssi_buffer_mgr_copy_scatterlist_portion(
uint32_t nents, lbytes;
nents = ssi_buffer_mgr_get_sgl_nents(sg, end, &lbytes, NULL);
- sg_copy_buffer(sg, nents, (void *)dest, (end - to_skip), 0, (direct == SSI_SG_TO_BUF));
+ sg_copy_buffer(sg, nents, (void *)dest, (end - to_skip + 1), to_skip,
+ (direct == SSI_SG_TO_BUF));
}
static inline int ssi_buffer_mgr_render_buff_to_mlli(