From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 765D3A0544;
	Mon, 10 Oct 2022 17:46:15 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 3209A427F6;
	Mon, 10 Oct 2022 17:46:15 +0200 (CEST)
Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com
 [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id 5E4934021E
 for <dev@dpdk.org>; Mon, 10 Oct 2022 17:46:13 +0200 (CEST)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id 0DE355C0162;
 Mon, 10 Oct 2022 11:46:13 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute4.internal (MEProxy); Mon, 10 Oct 2022 11:46:13 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:cc:content-transfer-encoding:content-type:date:date:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:sender:subject:subject:to:to; s=fm3; t=1665416773; x=
 1665503173; bh=y9yL8J2NqzKAgCIpIS963qAo6TYxpMANwRuQIPrMqHk=; b=j
 x7F5GhIlpyttH4glBl3duuAmNx4a56Xnvkas7hkBLKLeAnQGOSIFblqokpL7Xku2
 5by6ntrmkKj7IOliyinAF4lT0p5hmU4eWkogqT2YDLGLnci+bF97qsiTAqFk+vmX
 6yo/pkYKjnNydmQLVaud/V4TlOUFPmFaC0jk04EbWbD8pcW9gCaTXvDJDq/cRvGM
 2SgkOnlQ0aI3Oo1CJpUrFW1D72MB/L2MMH+XIkqGOwwPulKF9Iudk0epj3B8mZB9
 VdS9HLEIaeCCO4Uz+wfZwhX83iCS1uu7rP74bM8X87HAslM9HRcnaxnaphrac/Fr
 4pxGAzH71XZu0jHYkkHvg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:date:date:feedback-id:feedback-id:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1665416773; x=
 1665503173; bh=y9yL8J2NqzKAgCIpIS963qAo6TYxpMANwRuQIPrMqHk=; b=Q
 6EmSuNB3b6+IbNECBcHNAV0HrtQxzB1+nApqN+vB6Tpc0l/GFAas9OsRVqNqLH9C
 oIi9A8GaV0dLerobHBoro1YFqpe3CFNML5kso8oIvyiRsZ6FwVN7WqMU2QYu7RA8
 epugFh9E7RRw4pNYT6lenQmifRlmVUbWDFCEkidOCe+cw1Q3K3DhWNe3ae908UTX
 Na+vKrqJoart1spR2ohEAMoXp4NcBLDIFdcKAZ9DIoZGy2mkI+MRqBxoRGf36XoD
 5yKp1hhaXeos0olpc1gYf0gjs70ocPNOAo4mQL7Ksp72v+baYv0QyRBLsh3dTbc6
 EO8mVpWfAEN5ERL0jS2cg==
X-ME-Sender: <xms:RD5EY1Cp-Q8eYQT-W4We_mWK0dgK7YxrmIeaUuuDYsgVdMvhVMw26Q>
 <xme:RD5EYzgTIdlnIyn57s1w7N5RZf1CJUeq_ZBz7StXcBZAvsaVhWIKn0489JHHwDJLo
 qk8dgpmcBgPDGc8hA>
X-ME-Received: <xmr:RD5EYwnXWWlYITwWGs-CWhKwCQymziaH3iSQfTdCn0DZZM94hdMILSGjdPR8jDnnHGoxAcdQihWX5Pu5bAk03APxGg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeejgedgkeeiucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkfgjfhgggfgtsehtuf
 ertddttddvnecuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghs
 sehmohhnjhgrlhhonhdrnhgvtheqnecuggftrfgrthhtvghrnheptdejieeifeehtdffgf
 dvleetueeffeehueejgfeuteeftddtieekgfekudehtdfgnecuvehluhhsthgvrhfuihii
 vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonh
 drnhgvth
X-ME-Proxy: <xmx:RD5EY_wQouEIQL22OCaQdVJVL96tK7-Hg9FK4Vqq57IxFs8FeGF__A>
 <xmx:RD5EY6Rn1xk1mgvZXbxKnphYHYEflKAqtqAPkwzL9M1YQU4AkKDoGA>
 <xmx:RD5EYyYV68ufIO7aTBXjr1rMEizsSbYVdHK-JId3RHwNBsrp8y9nfw>
 <xmx:RT5EY1dForFHhnnkfBu9_L5t2D2gGf-G4iOT10HCxDcz0R-mSXz1lw>
Feedback-ID: i47234305:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 10 Oct 2022 11:46:12 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Shiqi Liu <835703180@qq.com>
Cc: pbhagavatula@marvell.com, dev@dpdk.org, jerinj@marvell.com
Subject: Re: [PATCH] lib: Check for the NULL pointer after calling malloc
Date: Mon, 10 Oct 2022 17:46:11 +0200
Message-ID: <3002219.ktpJ11cQ8Q@thomas>
In-Reply-To: <tencent_7A58A935B4A00F49E866CC56C6D08D05DD0A@qq.com>
References: <tencent_7A58A935B4A00F49E866CC56C6D08D05DD0A@qq.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

07/07/2022 11:23, 835703180@qq.com:
> From: Shiqi Liu <835703180@qq.com>
> 
> As the possible failure of the malloc(), the not_checked and
> checked could be NULL pointer.
> Therefore, it should be better to check it in order to avoid
> the dereference of the NULL pointer.
> 
> Fixes: fa8054c8c88 ("lib/node: add ethdev control")
> Signed-off-by: Shiqi Liu <835703180@qq.com>

Removed useless braces and applied, thanks.