From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] examples: fix unchecked malloc return value in ip_pipeline Date: Fri, 12 Dec 2014 16:34:27 +0100 Message-ID: <2237820.43UNApO07d@xps13> References: <1418387044-22569-1-git-send-email-bruce.richardson@intel.com> <3EB4FA525960D640B5BDFFD6A3D89126322DDC82@IRSMSX108.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: "Dumitrescu, Cristian" Return-path: In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D89126322DDC82-kPTMFJFq+rEMvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Hi Cristian, 2014-12-12 15:19, Dumitrescu, Cristian: > Acked by: Please, next time, - add you acked-by below the signed-off, - put your name and a real email address (like in a signed-off), - and remove the patch to make email shorter. I think the web site needs to be updated to explain such things. > -----Original Message----- > From: Richardson, Bruce > Sent: Friday, December 12, 2014 12:24 PM > To: dev-VfR2kkLFssw@public.gmane.org; Dumitrescu, Cristian > Cc: Richardson, Bruce > Subject: [PATCH] examples: fix unchecked malloc return value in ip_pipeline > > Static analysis shows that once instance of rte_zmalloc is missing > a return value check in the code. This is fixed by adding a return > value check. The malloc call itself is moved to earlier in the function > so that no work is done unless all memory allocation requests have > succeeded - thereby removing the need for rollback on error. > > Signed-off-by: Bruce Richardson > --- > examples/ip_pipeline/cmdline.c | 20 +++++++++++++------- > 1 file changed, 13 insertions(+), 7 deletions(-) > > diff --git a/examples/ip_pipeline/cmdline.c b/examples/ip_pipeline/cmdline.c > index 13d565e..152acb5 100644 > --- a/examples/ip_pipeline/cmdline.c > +++ b/examples/ip_pipeline/cmdline.c [...]