From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by dpdk.org (Postfix) with ESMTP id 601C880A8 for ; Fri, 12 Dec 2014 16:34:53 +0100 (CET) Received: by mail-wi0-f182.google.com with SMTP id h11so2961229wiw.3 for ; Fri, 12 Dec 2014 07:34:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=dc0mAYlrb+LoKACUv54Cmd2nJ44/BeZtNt83JTzvPAU=; b=fLS7JC2lHvsuLLe6gyaXU/qhMD5JRwL4oTDWBDjim1Z/DMUm9aAnTSkfQE0YpSUTT9 H2thkk6UnVqKfqbPJV+6UmfbNX39czOcQsn/OLx5qy9feMOpB+MrubE1f8rYTwFqThad TKBWycEjCpZ1jeX+iLne8VpS03/mZHjT5QIxvKafvSCaZmr6G8Ol4rbY0rMXTCp+jYpG ud5dSyG/j6LVlWevEEv51d4gMhv7rtWlfr+sqT5nn+9OBkBhxkrUX9o2ITBevpm178no XW6IZpGfed8kZdUb3lywJjpcfTtrq5ZFvlN7EnrnYXINwkXO01KXbiIbAUnFb4+n6YAz coJg== X-Gm-Message-State: ALoCoQk8SKts37L9ISzSKs4OUsMnGtw3OjWCdM5eOV6gi+1DgB32TyvGfuuTBvN/Yc/0Ugrn/L6F X-Received: by 10.195.12.76 with SMTP id eo12mr28444418wjd.22.1418398493125; Fri, 12 Dec 2014 07:34:53 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id j2sm2235146wjs.28.2014.12.12.07.34.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Dec 2014 07:34:52 -0800 (PST) From: Thomas Monjalon To: "Dumitrescu, Cristian" Date: Fri, 12 Dec 2014 16:34:27 +0100 Message-ID: <2237820.43UNApO07d@xps13> Organization: 6WIND User-Agent: KMail/4.14.3 (Linux/3.17.4-1-ARCH; KDE/4.14.3; x86_64; ; ) In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D89126322DDC82@IRSMSX108.ger.corp.intel.com> References: <1418387044-22569-1-git-send-email-bruce.richardson@intel.com> <3EB4FA525960D640B5BDFFD6A3D89126322DDC82@IRSMSX108.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] examples: fix unchecked malloc return value in ip_pipeline X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Dec 2014 15:34:53 -0000 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@dpdk.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 [...]