DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org, pablo.de.lara.guarch@intel.com
Subject: Re: [dpdk-dev] [PATCH v2] testpmd: fix crash when mempool allocation fails
Date: Fri, 9 Sep 2016 11:41:55 +0200	[thread overview]
Message-ID: <98b9684b-3614-85b7-7924-eba4022fec06@6wind.com> (raw)
In-Reply-To: <1473414022-10819-1-git-send-email-olivier.matz@6wind.com>

Sorry, I just resent the same one...

On 09/09/2016 11:40 AM, Olivier Matz wrote:
> Avoid access to mempool pointer if it is NULL.
> 
> Fixes: b19a0c75a0d4 ("app/testpmd: remove anonymous mempool code")
> Coverity issue: 127553
> 
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> ---
>  app/test-pmd/testpmd.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 1428974..e0f8285 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -444,10 +444,13 @@ mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf,
>  				mb_size, (unsigned) mb_mempool_cache,
>  				sizeof(struct rte_pktmbuf_pool_private),
>  				socket_id, 0);
> +			if (rte_mp == NULL)
> +				goto err;
>  
>  			if (rte_mempool_populate_anon(rte_mp) == 0) {
>  				rte_mempool_free(rte_mp);
>  				rte_mp = NULL;
> +				goto err;
>  			}
>  			rte_pktmbuf_pool_init(rte_mp, NULL);
>  			rte_mempool_obj_iter(rte_mp, rte_pktmbuf_init, NULL);
> @@ -458,6 +461,7 @@ mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf,
>  		}
>  	}
>  
> + err:
>  	if (rte_mp == NULL) {
>  		rte_exit(EXIT_FAILURE,
>  			"Creation of mbuf pool for socket %u failed: %s\n",
> 

  reply	other threads:[~2016-09-09  9:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09  8:16 [dpdk-dev] [PATCH] " Olivier Matz
2016-09-09  8:25 ` [dpdk-dev] [dpdk-stable] " Yuanhan Liu
2016-09-09  8:43   ` Olivier Matz
2016-09-09  9:40 ` [dpdk-dev] [PATCH v2] " Olivier Matz
2016-09-09  9:41   ` Olivier Matz [this message]
2016-09-09  9:42 ` [dpdk-dev] [PATCH v3] " Olivier Matz
2016-09-21 23:02   ` De Lara Guarch, Pablo
2016-09-23 18:17     ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

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=98b9684b-3614-85b7-7924-eba4022fec06@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).