net/nfp: fix uninitialized variable
Checks
Commit Message
CI found in the logic of 'nfp_aesgcm_iv_update()', the variable
'cfg_iv' may used uninitialized in some case.
Coverity issue: 415808
Fixes: 36361ca7fea2 ("net/nfp: fix data endianness problem")
Cc: shihong.wang@corigine.com
Cc: stable@dpdk.org
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
drivers/net/nfp/nfp_ipsec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 3/19/2024 8:55 AM, Chaoyong He wrote:
> CI found in the logic of 'nfp_aesgcm_iv_update()', the variable
> 'cfg_iv' may used uninitialized in some case.
>
> Coverity issue: 415808
> Fixes: 36361ca7fea2 ("net/nfp: fix data endianness problem")
> Cc: shihong.wang@corigine.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> Reviewed-by: Long Wu <long.wu@corigine.com>
> Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
>
Applied to dpdk-next-net/main, thanks.
@@ -526,7 +526,7 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
char *iv_b;
char *iv_str;
const rte_be32_t *iv_value;
- uint8_t cfg_iv[NFP_ESP_IV_LENGTH];
+ uint8_t cfg_iv[NFP_ESP_IV_LENGTH] = {};
iv_str = strdup(iv_string);
if (iv_str == NULL) {