From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 931EBDE0 for ; Wed, 5 Dec 2018 18:06:16 +0100 (CET) Received: by mail-pf1-f193.google.com with SMTP id b85so10325928pfc.3 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=YPfe1SuqEHa6sBbyYt4vdoVJ/qnBqE3NaaAM9nU2Wj9now/ROYQJ3bZIvnDN4yBxas 9wxe6QgWaoaWjdxh9oWQZYhDjizdPWtE1KTnG9gfFPHzNeX+ICOWU1p3Cpv5034/cxac /SABynTcpGFQd0OZDHWqWJ1nHy8YT73c4lEiVww24WppMFtpn/e9R7azkfwzFIOkZWTX Qlhp+YZOk5W9P5d5Njv792gvuwzWPDt91kJyj8giLyefgvTCupl7gWb73YMcpn7PPW5I be1vCWo/UDoWS0VVhhu8Jz3s7OtDYvSCPx8ONjSLZIyWj9V/aes2Y0NxZIQm8lxdiJxC EBJg== X-Gm-Message-State: AA+aEWYwXEcgwJ7E3KHSGbamyDZhQigUHBkpLwjo6iWv940TSFoR5Iym RZwXIrDHXcZhjCekj/l+zKdqRw== 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-stable] [dpdk-dev] [PATCH] lib: add warning for NULL pointer X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches 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.