[dpdk-stable] patch 'net/e1000: fix null pointer check' has been queued to LTS release 17.11.1
Yuanhan Liu
yliu at fridaylinux.org
Thu Feb 1 10:47:29 CET 2018
Hi,
FYI, your patch has been queued to LTS release 17.11.1
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/03/18. So please
shout if anyone has objections.
Thanks.
--yliu
---
>From 76f8876e860971cbfd1792fd79e388bcde7f265a Mon Sep 17 00:00:00 2001
From: Yong Wang <wang.yong19 at zte.com.cn>
Date: Thu, 25 Jan 2018 02:43:04 -0500
Subject: [PATCH] net/e1000: fix null pointer check
[ upstream commit 516e525ebfcf9875c86eb5ce88a536470e279739 ]
There are several func calls to rte_zmalloc() which don't have null
pointer check for the return value. It fixes that by adding null
pointer check.
Fixes: 22bb13410cb2 ("net/igb: create consistent filter")
Signed-off-by: Yong Wang <wang.yong19 at zte.com.cn>
Acked-by: Wenzhuo Lu <wenzhuo.lu at intel.com>
---
drivers/net/e1000/igb_flow.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c
index 22bad26..057579b 100644
--- a/drivers/net/e1000/igb_flow.c
+++ b/drivers/net/e1000/igb_flow.c
@@ -1345,6 +1345,11 @@ igb_flow_create(struct rte_eth_dev *dev,
if (!ret) {
ntuple_filter_ptr = rte_zmalloc("igb_ntuple_filter",
sizeof(struct igb_ntuple_filter_ele), 0);
+ if (!ntuple_filter_ptr) {
+ PMD_DRV_LOG(ERR, "failed to allocate memory");
+ goto out;
+ }
+
rte_memcpy(&ntuple_filter_ptr->filter_info,
&ntuple_filter,
sizeof(struct rte_eth_ntuple_filter));
@@ -1367,6 +1372,11 @@ igb_flow_create(struct rte_eth_dev *dev,
ethertype_filter_ptr = rte_zmalloc(
"igb_ethertype_filter",
sizeof(struct igb_ethertype_filter_ele), 0);
+ if (!ethertype_filter_ptr) {
+ PMD_DRV_LOG(ERR, "failed to allocate memory");
+ goto out;
+ }
+
rte_memcpy(ðertype_filter_ptr->filter_info,
ðertype_filter,
sizeof(struct rte_eth_ethertype_filter));
@@ -1387,6 +1397,11 @@ igb_flow_create(struct rte_eth_dev *dev,
if (!ret) {
syn_filter_ptr = rte_zmalloc("igb_syn_filter",
sizeof(struct igb_eth_syn_filter_ele), 0);
+ if (!syn_filter_ptr) {
+ PMD_DRV_LOG(ERR, "failed to allocate memory");
+ goto out;
+ }
+
rte_memcpy(&syn_filter_ptr->filter_info,
&syn_filter,
sizeof(struct rte_eth_syn_filter));
@@ -1408,6 +1423,11 @@ igb_flow_create(struct rte_eth_dev *dev,
if (!ret) {
flex_filter_ptr = rte_zmalloc("igb_flex_filter",
sizeof(struct igb_flex_filter_ele), 0);
+ if (!flex_filter_ptr) {
+ PMD_DRV_LOG(ERR, "failed to allocate memory");
+ goto out;
+ }
+
rte_memcpy(&flex_filter_ptr->filter_info,
&flex_filter,
sizeof(struct rte_eth_flex_filter));
--
2.7.4
More information about the stable
mailing list