[dpdk-stable] patch 'net/hinic: check memory allocations in flow creation' has been queued to stable release 19.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Aug 6 11:53:56 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/08/20. 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.

Thanks.

Luca Boccassi

---
>From 2c6c6d45a3d7926db96f7d19a086375ee9653ccc Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Tue, 28 Jul 2020 20:34:46 +0800
Subject: [PATCH] net/hinic: check memory allocations in flow creation

[ upstream commit d7964ce192e79507d3b32b4a02e6293a40eb4708 ]

The function rte_zmalloc() could return NULL, the return
value need to be checked.

Fixes: f4ca3fd54c4d ("net/hinic: create and destroy flow director filter")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 drivers/net/hinic/hinic_pmd_flow.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/hinic/hinic_pmd_flow.c b/drivers/net/hinic/hinic_pmd_flow.c
index 49c9d8768..6752a8f15 100644
--- a/drivers/net/hinic/hinic_pmd_flow.c
+++ b/drivers/net/hinic/hinic_pmd_flow.c
@@ -2112,6 +2112,10 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
 		if (!ret) {
 			ntuple_filter_ptr = rte_zmalloc("hinic_ntuple_filter",
 				sizeof(struct hinic_ntuple_filter_ele), 0);
+			if (ntuple_filter_ptr == NULL) {
+				PMD_DRV_LOG(ERR, "Failed to allocate ntuple_filter_ptr");
+				goto out;
+			}
 			rte_memcpy(&ntuple_filter_ptr->filter_info,
 				   &ntuple_filter,
 				   sizeof(struct rte_eth_ntuple_filter));
@@ -2138,6 +2142,10 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
 			ethertype_filter_ptr =
 				rte_zmalloc("hinic_ethertype_filter",
 				sizeof(struct hinic_ethertype_filter_ele), 0);
+			if (ethertype_filter_ptr == NULL) {
+				PMD_DRV_LOG(ERR, "Failed to allocate ethertype_filter_ptr");
+				goto out;
+			}
 			rte_memcpy(&ethertype_filter_ptr->filter_info,
 				&ethertype_filter,
 				sizeof(struct rte_eth_ethertype_filter));
@@ -2162,6 +2170,10 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
 		if (!ret) {
 			fdir_rule_ptr = rte_zmalloc("hinic_fdir_rule",
 				sizeof(struct hinic_fdir_rule_ele), 0);
+			if (fdir_rule_ptr == NULL) {
+				PMD_DRV_LOG(ERR, "Failed to allocate fdir_rule_ptr");
+				goto out;
+			}
 			rte_memcpy(&fdir_rule_ptr->filter_info, &fdir_rule,
 				sizeof(struct hinic_fdir_rule));
 			TAILQ_INSERT_TAIL(&nic_dev->filter_fdir_rule_list,
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-08-06 10:53:16.893092228 +0100
+++ 0028-net-hinic-check-memory-allocations-in-flow-creation.patch	2020-08-06 10:53:15.812597639 +0100
@@ -1,13 +1,14 @@
-From d7964ce192e79507d3b32b4a02e6293a40eb4708 Mon Sep 17 00:00:00 2001
+From 2c6c6d45a3d7926db96f7d19a086375ee9653ccc Mon Sep 17 00:00:00 2001
 From: Yunjian Wang <wangyunjian at huawei.com>
 Date: Tue, 28 Jul 2020 20:34:46 +0800
 Subject: [PATCH] net/hinic: check memory allocations in flow creation
 
+[ upstream commit d7964ce192e79507d3b32b4a02e6293a40eb4708 ]
+
 The function rte_zmalloc() could return NULL, the return
 value need to be checked.
 
 Fixes: f4ca3fd54c4d ("net/hinic: create and destroy flow director filter")
-Cc: stable at dpdk.org
 
 Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
 Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
@@ -16,10 +17,10 @@
  1 file changed, 12 insertions(+)
 
 diff --git a/drivers/net/hinic/hinic_pmd_flow.c b/drivers/net/hinic/hinic_pmd_flow.c
-index a7bad570b..503a32fff 100644
+index 49c9d8768..6752a8f15 100644
 --- a/drivers/net/hinic/hinic_pmd_flow.c
 +++ b/drivers/net/hinic/hinic_pmd_flow.c
-@@ -2977,6 +2977,10 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
+@@ -2112,6 +2112,10 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
  		if (!ret) {
  			ntuple_filter_ptr = rte_zmalloc("hinic_ntuple_filter",
  				sizeof(struct hinic_ntuple_filter_ele), 0);
@@ -30,7 +31,7 @@
  			rte_memcpy(&ntuple_filter_ptr->filter_info,
  				   &ntuple_filter,
  				   sizeof(struct rte_eth_ntuple_filter));
-@@ -3003,6 +3007,10 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
+@@ -2138,6 +2142,10 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
  			ethertype_filter_ptr =
  				rte_zmalloc("hinic_ethertype_filter",
  				sizeof(struct hinic_ethertype_filter_ele), 0);
@@ -41,7 +42,7 @@
  			rte_memcpy(&ethertype_filter_ptr->filter_info,
  				&ethertype_filter,
  				sizeof(struct rte_eth_ethertype_filter));
-@@ -3036,6 +3044,10 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
+@@ -2162,6 +2170,10 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
  		if (!ret) {
  			fdir_rule_ptr = rte_zmalloc("hinic_fdir_rule",
  				sizeof(struct hinic_fdir_rule_ele), 0);


More information about the stable mailing list