DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Gao Feng <davidfgao@tencent.com>
Cc: dev@dpdk.org, "Burakov, Anatoly" <anatoly.burakov@intel.com>,
	gfree.wind@vip.163.com
Subject: Re: [dpdk-dev] [PATCH] eal: Add the check for null peer pointer in mp request handler
Date: Wed, 19 Dec 2018 23:45:07 +0100	[thread overview]
Message-ID: <3715484.jA0p6cb1Xu@xps> (raw)
In-Reply-To: <23a41184-d366-ca83-4815-143ac350735e@intel.com>

10/12/2018 17:41, Burakov, Anatoly:
> On 05-Dec-18 6:19 AM, gfree.wind@vip.163.com wrote:
> > From: Gao Feng <davidfgao@tencent.com>
> > 
> > Add the check for null peer pointer like the bundle pointer in the mp request
> > handler. They should follow same style. And add some logs for nomem cases.
> > 
> > Signed-off-by: Gao Feng <davidfgao@tencent.com>
> > ---
> >   lib/librte_eal/common/hotplug_mp.c | 15 +++++++++++++++
> >   1 file changed, 15 insertions(+)
> > 
> > diff --git a/lib/librte_eal/common/hotplug_mp.c b/lib/librte_eal/common/hotplug_mp.c
> > index 070e2e0..0d2996f 100644
> > --- a/lib/librte_eal/common/hotplug_mp.c
> > +++ b/lib/librte_eal/common/hotplug_mp.c
> > @@ -200,6 +200,11 @@ static int cmp_dev_name(const struct rte_device *dev, const void *_name)
> >   	 * when it is ready.
> >   	 */
> >   	bundle->peer = strdup(peer);
> > +	if (bundle->peer == NULL) {
> > +		free(bundle);
> > +		RTE_LOG(ERR, EAL, "not enough memory\n");
> 
> The error should probably be more descriptive (as in, it should be 
> easier to identify where it came from). Suggested rewording:
> 
> "hotplug: cannot allocate memory for bundle"
> 
> or something along those lines. Same for other log messages.
> 
> As for actual code,
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks

      reply	other threads:[~2018-12-19 22:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05  6:19 gfree.wind
2018-12-10 16:41 ` Burakov, Anatoly
2018-12-19 22:45   ` Thomas Monjalon [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=3715484.jA0p6cb1Xu@xps \
    --to=thomas@monjalon.net \
    --cc=anatoly.burakov@intel.com \
    --cc=davidfgao@tencent.com \
    --cc=dev@dpdk.org \
    --cc=gfree.wind@vip.163.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).