diff options
author | Horia Geanta <horia.geanta@freescale.com> | 2015-05-08 15:33:33 (GMT) |
---|---|---|
committer | Honghua Yin <Hong-Hua.Yin@freescale.com> | 2015-05-13 08:03:03 (GMT) |
commit | f11665f4997debcce6f8c7f3c0e7a84d9dcf5bb0 (patch) | |
tree | 0e1ac4b02005207c27a6d18d8f4ebd0cc109b29b | |
parent | 8aa7fc35dabf261899525f3da29ea21a111b3707 (diff) | |
download | linux-fsl-qoriq-f11665f4997debcce6f8c7f3c0e7a84d9dcf5bb0.tar.xz |
Revert "crypto: talitos - convert to use be16_add_cpu()"
This reverts commit 7291a932c6e27d9768e374e9d648086636daf61c.
The conversion to be16_add_cpu() is incorrect in case cryptlen is
negative due to premature (i.e. before addition / subtraction)
implicit conversion of cryptlen (int -> u16) leading to sign loss.
Change-Id: Iee27eb0881df6f1134f977cbe471cd23479752ce
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/36123
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Tudor-Dan Ambarus <tudor.ambarus@freescale.com>
Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
-rw-r--r-- | drivers/crypto/talitos.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 1edb686..e9163ab 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -1316,7 +1316,8 @@ static int sg_to_link_tbl(struct scatterlist *sg, int sg_count, sg_count--; link_tbl_ptr--; } - be16_add_cpu(&link_tbl_ptr->len, cryptlen); + link_tbl_ptr->len = cpu_to_be16(be16_to_cpu(link_tbl_ptr->len) + + cryptlen); /* tag end of link table */ link_tbl_ptr->j_extent = DESC_PTR_LNKTBL_RETURN; |