[dpdk-stable] patch 'net/mlx5: check memory allocation in flow creation' has been queued to LTS release 18.11.3

Kevin Traynor ktraynor at redhat.com
Tue Aug 27 11:29:50 CEST 2019


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 <asafp at mellanox.com>
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 <asafp at mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
---
 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 at 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 &&


More information about the stable mailing list