> [You don't often get email from fengcheng...@huawei.com. Learn why this
> is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> Add verify strdup return value logic.
> 
> Fixes: 3d21da66c06b ("net/nfp: create security session")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Chengwen Feng <fengcheng...@huawei.com>
> ---
>  drivers/net/nfp/nfp_ipsec.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/nfp/nfp_ipsec.c b/drivers/net/nfp/nfp_ipsec.c index
> 452947380e..7ce9cca0b2 100644
> --- a/drivers/net/nfp/nfp_ipsec.c
> +++ b/drivers/net/nfp/nfp_ipsec.c
> @@ -524,6 +524,11 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
>         uint8_t *cfg_iv;
> 
>         iv_str = strdup(iv_string);
> +       if (iv_str == NULL) {
> +               PMD_DRV_LOG(ERR, "Failed to strdup iv_string");
> +               return;
> +       }
> +
>         cfg_iv = (uint8_t *)cfg->aesgcm_fields.iv;
> 
>         for (i = 0; i < iv_len; i++) {
> --
> 2.17.1

Looks good tome.
Thanks.

Acked-by: Chaoyong He <chaoyong...@corigine.com>

Reply via email to