[2/4] crypto/dpaa2_sec: fix HFN override
diff mbox series

Message ID 20200706183500.29862-2-akhil.goyal@nxp.com
State Accepted
Delegated to: akhil goyal
Headers show
Series
  • [1/4] crypto/dpaax_sec: fix inline query for descriptors
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Akhil Goyal July 6, 2020, 6:34 p.m. UTC
HFN is set as a uint32_t but the value retrieved is
uint8_t. Fixed the type casting to get the correct value.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Akhil Goyal July 7, 2020, 10:34 p.m. UTC | #1
> 
> HFN is set as a uint32_t but the value retrieved is
> uint8_t. Fixed the type casting to get the correct value.
> 
> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> ---
Updated Fixes while applying patches.

    Fixes: bef594ec5cc8 ("crypto/dpaa2_sec: support PDCP offload")
    Fixes: af61f0750948 ("crypto/dpaa2_sec: support scatter gather for proto offloads")
    Cc: stable@dpdk.org

Patch
diff mbox series

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index c56fb2152..109e61ae1 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -1,7 +1,7 @@ 
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2016-2019 NXP
+ *   Copyright 2016-2020 NXP
  *
  */
 
@@ -164,7 +164,8 @@  build_proto_compound_sg_fd(dpaa2_sec_session *sess,
 	 * mbuf priv after sym_op.
 	 */
 	if (sess->ctxt_type == DPAA2_SEC_PDCP && sess->pdcp.hfn_ovd) {
-		uint32_t hfn_ovd = *((uint8_t *)op + sess->pdcp.hfn_ovd_offset);
+		uint32_t hfn_ovd = *(uint32_t *)((uint8_t *)op +
+					sess->pdcp.hfn_ovd_offset);
 		/*enable HFN override override */
 		DPAA2_SET_FLE_INTERNAL_JD(ip_fle, hfn_ovd);
 		DPAA2_SET_FLE_INTERNAL_JD(op_fle, hfn_ovd);
@@ -239,7 +240,8 @@  build_proto_compound_fd(dpaa2_sec_session *sess,
 	 * mbuf priv after sym_op.
 	 */
 	if (sess->ctxt_type == DPAA2_SEC_PDCP && sess->pdcp.hfn_ovd) {
-		uint32_t hfn_ovd = *((uint8_t *)op + sess->pdcp.hfn_ovd_offset);
+		uint32_t hfn_ovd = *(uint32_t *)((uint8_t *)op +
+					sess->pdcp.hfn_ovd_offset);
 		/*enable HFN override override */
 		DPAA2_SET_FLE_INTERNAL_JD(ip_fle, hfn_ovd);
 		DPAA2_SET_FLE_INTERNAL_JD(op_fle, hfn_ovd);