From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id C1C7B1F28 for ; Wed, 5 Dec 2018 18:06:16 +0100 (CET) Received: by mail-pf1-f194.google.com with SMTP id g62so10300032pfd.12 for ; Wed, 05 Dec 2018 09:06:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ToNZqCxAQeRn/S8UCFpe3uC1qI+ciba77qjXX2/iZzU=; b=fYVkWj0rkRhj2/6cJk+s7ejGJEYx6XnxaMPnx71X3nbA9whJnW/tCNf82hbCPURmFl POdgLYSHsxyK5xbFx62e2RElUMrqZP/WOfBksxQJ1HdxPK7A2ktS/0DBmBvh/W6S0DQr 1fAN4+Jrn4eGI704zrpGZzxtNOAEdpMxjQVQVOBTxYUjWYJOaZHZTQk7IWfELTH9EEjm cJaAHQhcS+N1BZquSRP7KaL5HtnSTsXusLrixR57QrXbxtiqBWzDdJrL8UzkWads1vNw oj1E1eMO8Bj24w0Pp8B5nn9CMr2rJGO8nXT9QW6Dq2uSUih8zzGYdlw0f4C6X165paiT H0xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ToNZqCxAQeRn/S8UCFpe3uC1qI+ciba77qjXX2/iZzU=; b=qSuD1I7xdiV13b+iUwJHfW5nS0p+GU7E7p64drWKTQlduhO2LU5MmDU61vld10+U2A 4mhyUC0yE3vENDW1dvUizx7SSA9WLQlR52Ar2TQPcsaLqpjp+z2cAwkljVxO6J15GvrK FmvV20oF6YrulmuknlR9b/ZyniwH7WkfKunFa6S0g1y3s8sAV7Lys6U+HXrOYb3gwj8C DQqZdU34m08Y+3qW9e8p30sd5pzGzbqa7eDjwDD5IaZ42jDeY3cVNASb9izFUTWyHD4m KHt1B/g5YR303JyFLVitgJUy9/FLulorxO+T50P3rlX1Wvm7NiQV0BkR54eC95RM7I2Y 0Xvw== X-Gm-Message-State: AA+aEWaVRt1UKr9bAZqcXA+saUaSIid2d5mu2Jo8ZBOSPqEicJnR8XNh geyHLzGj+stHxqDU/Nw6zkj4uw== X-Google-Smtp-Source: AFSGD/UnJGDApqAN5KfaJF9cMZPLVUksBkYt3gdoJ+4Nj4NnnF/JsZIvwGEijMGZYt6LVQuD94YLSg== X-Received: by 2002:a62:160d:: with SMTP id 13mr24903943pfw.203.1544029575679; Wed, 05 Dec 2018 09:06:15 -0800 (PST) Received: from xeon-e3 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id r66sm31165007pfk.157.2018.12.05.09.06.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 09:06:15 -0800 (PST) Date: Wed, 5 Dec 2018 09:06:13 -0800 From: Stephen Hemminger To: Qiming Yang Cc: dev@dpdk.org, stable@dpdk.org Message-ID: <20181205090613.2aee7fed@xeon-e3> In-Reply-To: <20181205115531.17073-1-qiming.yang@intel.com> References: <20181205115531.17073-1-qiming.yang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] lib: add warning for NULL pointer 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, 05 Dec 2018 17:06:17 -0000 On Wed, 5 Dec 2018 19:55:31 +0800 Qiming Yang wrote: > May return NULL when manage tries for packet in acl library. So > this patch added warning for the NULL pointer return. > > Fixes: 074f54ad03ee ("acl: fix build and runtime for default target") > Cc: stable@dpdk.org > > Signed-off-by: Qiming Yang > --- > lib/librte_acl/acl_run.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/lib/librte_acl/acl_run.h b/lib/librte_acl/acl_run.h > index bf7842d..6c718c0 100644 > --- a/lib/librte_acl/acl_run.h > +++ b/lib/librte_acl/acl_run.h > @@ -143,6 +143,9 @@ acl_start_next_trie(struct acl_flow_data *flows, struct parms *parms, int n, > flows->num_packets * flows->categories); > } > > + if (flows->last_cmplt == NULL) > + RTE_LOG(WARNING, MALLOC, "packet tries allocate failed"); > + > /* set completion parameters and starting index for this slot */ > parms[n].cmplt = flows->last_cmplt; > transition = It would be better to return -ENOMEM and let caller handle the error.