[PATCH 08/16] net/nfp: verify strdup return value
Chaoyong He
chaoyong.he at corigine.com
Fri Nov 10 07:58:32 CET 2023
> [You don't often get email from fengchengwen at 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: stable at dpdk.org
>
> Signed-off-by: Chengwen Feng <fengchengwen at 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.he at corigine.com>
More information about the dev
mailing list