From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F32D6A0613 for ; Tue, 27 Aug 2019 11:31:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ECD9E1BFE1; Tue, 27 Aug 2019 11:31:01 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 394D01C0D8 for ; Tue, 27 Aug 2019 11:31:01 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AEE761018978; Tue, 27 Aug 2019 09:31:00 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-48.ams2.redhat.com [10.36.117.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id B24755C1B2; Tue, 27 Aug 2019 09:30:59 +0000 (UTC) From: Kevin Traynor To: Asaf Penso Cc: Viacheslav Ovsiienko , dpdk stable Date: Tue, 27 Aug 2019 10:29:50 +0100 Message-Id: <20190827093032.20423-13-ktraynor@redhat.com> In-Reply-To: <20190827093032.20423-1-ktraynor@redhat.com> References: <20190827093032.20423-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Tue, 27 Aug 2019 09:31:00 +0000 (UTC) Subject: [dpdk-stable] patch 'net/mlx5: check memory allocation in flow creation' has been queued to LTS release 18.11.3 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 09/03/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/6b4c2b9eabf1dda85801605c3018f38055d63f78 Thanks. Kevin Traynor --- >From 6b4c2b9eabf1dda85801605c3018f38055d63f78 Mon Sep 17 00:00:00 2001 From: Asaf Penso Date: Wed, 19 Jun 2019 09:46:24 +0000 Subject: [PATCH] net/mlx5: check memory allocation in flow creation [ upstream commit 3f22e3153fb5bd1ae2eebfa77678117eb15b33d8 ] rte_calloc functions returns a non-null pointer in case of success and null pointer in case of failure. The return value should be checked and the function flow should take that into consideration. This patch adds a check for rte_calloc return value in function flow_list_create. Fixes: 84c406e74524 ("net/mlx5: add flow translate function") Signed-off-by: Asaf Penso Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 5eb6c7b55..de8a77686 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2070,4 +2070,8 @@ flow_list_create(struct rte_eth_dev *dev, struct mlx5_flows *list, flow_size += RTE_ALIGN_CEIL(sizeof(uint16_t), sizeof(void *)); flow = rte_calloc(__func__, 1, flow_size, 0); + if (!flow) { + rte_errno = ENOMEM; + return NULL; + } flow->drv_type = flow_get_drv_type(dev, attr); assert(flow->drv_type > MLX5_FLOW_TYPE_MIN && -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-08-27 09:40:11.610319577 +0100 +++ 0013-net-mlx5-check-memory-allocation-in-flow-creation.patch 2019-08-27 09:40:10.866145699 +0100 @@ -1 +1 @@ -From 3f22e3153fb5bd1ae2eebfa77678117eb15b33d8 Mon Sep 17 00:00:00 2001 +From 6b4c2b9eabf1dda85801605c3018f38055d63f78 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 3f22e3153fb5bd1ae2eebfa77678117eb15b33d8 ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index cd04c446b..dc4825279 100644 +index 5eb6c7b55..de8a77686 100644 @@ -28 +29 @@ -@@ -2092,4 +2092,8 @@ flow_list_create(struct rte_eth_dev *dev, struct mlx5_flows *list, +@@ -2070,4 +2070,8 @@ flow_list_create(struct rte_eth_dev *dev, struct mlx5_flows *list, @@ -36 +37 @@ - flow->ingress = attr->ingress; + assert(flow->drv_type > MLX5_FLOW_TYPE_MIN &&