From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id ABF3210A3 for ; Wed, 19 Dec 2018 23:45:10 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 257FC22040; Wed, 19 Dec 2018 17:45:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 19 Dec 2018 17:45:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=ziYF9obvCP96qufU+CL9DaacK0Sb7FKsc57w8Ax7Fa4=; b=ReIB0APalbjJ DvUdHesyRcMPcYa7VAJaJHiCTGO0rv2R4TFbjKzrJaE8dvqj69lObS3zEmI9j9cK A5ZvOU0/cqSXgEWWR5a7dfcOSp13i7zoQX0quyWCVJIayC/Jju9FxukTt6+1DcU0 IXC4Dh6rByiE1zpriz1HhQT1j02TUcI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=ziYF9obvCP96qufU+CL9DaacK0Sb7FKsc57w8Ax7F a4=; b=Wz/e3RqohZDKIKofi62dUD1fWSPriU0cZu89fRKevYDmcA/bLhVb+AMYB j1jzU500zPVALuPatjkmamtNs+BvEmwLmuIwD9NDwmRyEOlQOhnMcRzcofniZUjG 6JmePrY9FLQnQ8U0PsPgz8+OM8ohEMTBAa9VhhtDkonLG/YXkUAX0ypsAfDKbAuC Ez5cqHY8ODoHU+1nhjyiSxz6rMF1sthZce9YakOMISJ55BezvQJMICgd3sTb0c4K SP+Ih8V0DxlgHI9HGYZ+y7XtTizZQG/uA2JEBibnCsPLC1FpHPvbrwgpPtee1KXF wkmGF9xDikARO7VOSiA5AzRbIAQbg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtkedrudejudcutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedttden ucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggf gtsehtufertddttddvnecuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhh ohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecukfhppeejjedrudefgedrvddtfedrud ekgeenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdr nhgvthenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 4C7EBE40A1; Wed, 19 Dec 2018 17:45:08 -0500 (EST) From: Thomas Monjalon To: Gao Feng Cc: dev@dpdk.org, "Burakov, Anatoly" , gfree.wind@vip.163.com Date: Wed, 19 Dec 2018 23:45:07 +0100 Message-ID: <3715484.jA0p6cb1Xu@xps> In-Reply-To: <23a41184-d366-ca83-4815-143ac350735e@intel.com> References: <1543990764-32140-1-git-send-email-gfree.wind@vip.163.com> <23a41184-d366-ca83-4815-143ac350735e@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] eal: Add the check for null peer pointer in mp request handler X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 22:45:11 -0000 10/12/2018 17:41, Burakov, Anatoly: > On 05-Dec-18 6:19 AM, gfree.wind@vip.163.com wrote: > > From: Gao Feng > > > > 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 > > --- > > 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 Applied, thanks