From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 747293F9 for ; Thu, 18 Dec 2014 22:06:03 +0100 (CET) Received: by mail-wg0-f47.google.com with SMTP id n12so2737292wgh.20 for ; Thu, 18 Dec 2014 13:06:03 -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=PBYulf/35L+0MhG8ktTJqpePbKnLdVb3aYQIVxJA3dY=; b=T5ODDn3izV5Vf2Hdo8sBJJzMGL33roIT26XXzeX7/n7DENpazl0vbjW7GL4u9SS90f PX6+qxC6muSm7ie0il96CrPFB3aibLMtjaLd017XBehHSIUI82fiBQ5Xn8aMFQ7WG/qA VhFQEievD0XkAnm7H2zfXGoN2eXjQV2yr0xs1yPyzIr6C4faSl5s5KH02CtBBXefXVDQ mfYSUabVr1DJMrgolJtbq2bB2WSNq9/+V0Q2J/z8ey4KUmZQEZN0O6Zg2Nn3HCelTIAs TQdyZJPBZuyKxW55FJdZdh7YA9tdeamnvvxGeiaYPCdC1rsGNdJt3xke7bIr7AY70p7i 9KtA== X-Gm-Message-State: ALoCoQmrtryzOLSpKUiBhW1Uzyp20AXeP48lC9S4rFquPeFRzpefj2gZjHJbF8o/wsU4hZEMz8gl X-Received: by 10.180.208.81 with SMTP id mc17mr8755333wic.47.1418936763381; Thu, 18 Dec 2014 13:06:03 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id hz9sm10326342wjb.17.2014.12.18.13.06.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Dec 2014 13:06:02 -0800 (PST) From: Thomas Monjalon To: Daniel Mrzyglod Date: Thu, 18 Dec 2014 22:05:34 +0100 Message-ID: <20867625.qP6gkIlEQ3@xps13> Organization: 6WIND User-Agent: KMail/4.14.3 (Linux/3.17.4-1-ARCH; KDE/4.14.3; x86_64; ; ) In-Reply-To: <1418895707-468-1-git-send-email-danielx.t.mrzyglod@intel.com> References: <1418895707-468-1-git-send-email-danielx.t.mrzyglod@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] test: fix missing NULL pointer checks 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: Thu, 18 Dec 2014 21:06:03 -0000 2014-12-18 09:41, Daniel Mrzyglod: > In test_sched, we are missing NULL pointer checks after calls to create the > mempool and to allocate an mbuf. Add in these checks using VERIFY macros. > > Signed-off-by: Daniel Mrzyglod > --- > app/test/test_sched.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/app/test/test_sched.c b/app/test/test_sched.c > index c957d80..9b6e037 100644 > --- a/app/test/test_sched.c > +++ b/app/test/test_sched.c > @@ -166,6 +166,7 @@ test_sched(void) > int err; > > mp = create_mempool(); > + VERIFY(mp != NULL,"Error create mempool\n"); A space is missing after the comma. Is "Error creating mempool" more correct? > port_param.socket = 0; > port_param.rate = (uint64_t) 10000 * 1000 * 1000 / 8; > @@ -184,6 +185,7 @@ test_sched(void) > > for (i = 0; i < 10; i++) { > in_mbufs[i] = rte_pktmbuf_alloc(mp); > + VERIFY(in_mbufs[i] != NULL, "Bad packet allocation"); An \n is missing. "Packet allocation failed" seems more appropriate. -- Thomas