Current code for getting crypto status is using sizeof() of cap struct
instead of status structure. This is not a big problem because cap struct
is a lot bigger, but the code is misleading. Fix it to use the correct
struct.

Fixes: 3940cd9b8cb3 ("net/iavf: fix device initialization without inline 
crypto")
Cc: [email protected]
Cc: [email protected]

Reported-by: Stephen Hemminger <[email protected]>
Signed-off-by: Anatoly Burakov <[email protected]>
---
 drivers/net/intel/iavf/iavf_ipsec_crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/intel/iavf/iavf_ipsec_crypto.c 
b/drivers/net/intel/iavf/iavf_ipsec_crypto.c
index 6d41b1744e..ab41b1973e 100644
--- a/drivers/net/intel/iavf/iavf_ipsec_crypto.c
+++ b/drivers/net/intel/iavf/iavf_ipsec_crypto.c
@@ -1600,7 +1600,7 @@ iavf_ipsec_crypto_status_get(struct iavf_adapter *adapter,
        }
 
        response_len = sizeof(struct inline_ipsec_msg) +
-                       sizeof(struct virtchnl_ipsec_cap);
+                       sizeof(struct virtchnl_ipsec_status);
        response = rte_malloc("iavf-device-status-response",
                        response_len, 0);
        if (response == NULL) {
-- 
2.47.3

Reply via email to