All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Evgeny Sokolov <Evgeny.Sokolov@infotecs.ru>
Cc: Kishore Padmanabha <kishore.padmanabha@broadcom.com>,
	Ajit Khaparde <ajit.khaparde@broadcom.com>,
	Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>,
	<dev@dpdk.org>, <stable@dpdk.org>
Subject: Re: [PATCH] net/bnxt: fix ctx_dma_arr allocation size
Date: Tue, 15 Sep 2026 07:34:59 -0700	[thread overview]
Message-ID: <20260915073459.106fb066@phoenix.local> (raw)
In-Reply-To: <20260915085606.430987-1-Evgeny.Sokolov@infotecs.ru>

On Tue, 15 Sep 2026 08:56:06 +0000
Evgeny Sokolov <Evgeny.Sokolov@infotecs.ru> wrote:

> From: Sokolov Evgeny <Evgeny.Sokolov@infotecs.ru>
> 
> ctx_dma_arr stores rte_iova_t entries, but the allocation size was
> calculated using sizeof(rte_iova_t *) instead of sizeof(rte_iova_t).
> 
> Use the correct element size when allocating the array to match the
> actual data type stored in ctx_dma_arr.
> 
> Fixes: 4371b402c7b ("net/bnxt: fix array overflow")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Sokolov Evgeny <Evgeny.Sokolov@infotecs.ru>
> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index a2429561b9..2754725566 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -5054,7 +5054,7 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
>  
>  	snprintf(name, RTE_MEMZONE_NAMESIZE, "bnxt_ctx_dma_arr%s_%x_%d",
>  		 suffix, idx, bp->eth_dev->data->port_id);
> -	ctx_pg->ctx_dma_arr = rte_zmalloc(name, sizeof(rte_iova_t *) * rmem->nr_pages, 0);
> +	ctx_pg->ctx_dma_arr = rte_zmalloc(name, sizeof(rte_iova_t) * rmem->nr_pages, 0);
>  	if (ctx_pg->ctx_dma_arr == NULL)
>  		return -ENOMEM;
>  

Maybe use rte_calloc() instead but fine as is.

Acked-by: Stephen Hemminger <stephen@networkplumber.org>

      reply	other threads:[~2026-09-15 14:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15  8:56 [PATCH] net/bnxt: fix ctx_dma_arr allocation size Evgeny Sokolov
2026-09-15 14:34 ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260915073459.106fb066@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=Evgeny.Sokolov@infotecs.ru \
    --cc=ajit.khaparde@broadcom.com \
    --cc=damodharam.ammepalli@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=kishore.padmanabha@broadcom.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.