patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: wangyunjian <wangyunjian@huawei.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dpdk-dev <dev@dpdk.org>, Liron Himi <lironh@marvell.com>,
	Zyta Szpak <zr@semihalf.com>,
	 "Lilijun (Jerry)" <jerry.lilijun@huawei.com>,
	xudingke <xudingke@huawei.com>,  dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mvneta: check allocation in rx queue flush
Date: Tue, 12 Jan 2021 19:51:06 +0530
Message-ID: <CALBAE1O6M6RisAGO4HO4uSGOT8M_=tOCSyP6hVN_YD_rC5hAwg@mail.gmail.com> (raw)
In-Reply-To: <1607341035-9372-1-git-send-email-wangyunjian@huawei.com>

On Mon, Dec 7, 2020 at 5:07 PM wangyunjian <wangyunjian@huawei.com> wrote:
>
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> The function rte_malloc() could return NULL, the return value
> need to be checked.
>
> Fixes: ce7ea764597e ("net/mvneta: support Rx/Tx")
> Cc: stable@dpdk.org
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>

Acked-by: Liron Himi <lironh@marvell.com>
Applied to dpdk-next-net-mrvl/for-main. Thanks



> ---
>  drivers/net/mvneta/mvneta_rxtx.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/mvneta/mvneta_rxtx.c b/drivers/net/mvneta/mvneta_rxtx.c
> index 10b6f57584..dfa7ecc090 100644
> --- a/drivers/net/mvneta/mvneta_rxtx.c
> +++ b/drivers/net/mvneta/mvneta_rxtx.c
> @@ -872,7 +872,17 @@ mvneta_rx_queue_flush(struct mvneta_rxq *rxq)
>         int ret, i;
>
>         descs = rte_malloc("rxdesc", MRVL_NETA_RXD_MAX * sizeof(*descs), 0);
> +       if (descs == NULL) {
> +               MVNETA_LOG(ERR, "Failed to allocate descs.");
> +               return;
> +       }
> +
>         bufs = rte_malloc("buffs", MRVL_NETA_RXD_MAX * sizeof(*bufs), 0);
> +       if (bufs == NULL) {
> +               MVNETA_LOG(ERR, "Failed to allocate bufs.");
> +               rte_free(descs);
> +               return;
> +       }
>
>         do {
>                 num = MRVL_NETA_RXD_MAX;
> --
> 2.23.0
>

      parent reply	other threads:[~2021-01-12 14:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07 11:37 wangyunjian
2020-12-07 12:37 ` [dpdk-stable] [EXT] " Liron Himi
2020-12-07 13:07   ` wangyunjian
2020-12-15 22:29     ` Liron Himi
2021-01-12 14:21 ` Jerin Jacob [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='CALBAE1O6M6RisAGO4HO4uSGOT8M_=tOCSyP6hVN_YD_rC5hAwg@mail.gmail.com' \
    --to=jerinjacobk@gmail.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerry.lilijun@huawei.com \
    --cc=lironh@marvell.com \
    --cc=stable@dpdk.org \
    --cc=wangyunjian@huawei.com \
    --cc=xudingke@huawei.com \
    --cc=zr@semihalf.com \
    /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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git