From: Yuying Zhang <yuying.zhang@intel.com>
To: dev@dpdk.org, qi.z.zhang@intel.com
Cc: Yuying Zhang <yuying.zhang@intel.com>, stable@dpdk.org
Subject: [PATCH v1] net/ice: fix memory allocation issue of packet flag
Date: Tue, 28 Jun 2022 04:06:51 +0000 [thread overview]
Message-ID: <20220628040651.755135-1-yuying.zhang@intel.com> (raw)
Current code doesn't allocate memory of lookup element to add packet
flag. This patch adds one lookup item in the list to fix this memory
issue.
Fixes: 8b95092b7f69 ("net/ice/base: fix direction of flow that matches any")
Cc: stable@dpdk.org
Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
---
drivers/net/ice/ice_switch_filter.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index 36c9bffb73..e84283fec1 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -1863,7 +1863,10 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad,
else if (vlan_num == 2)
tun_type = ICE_NON_TUN_QINQ;
- list = rte_zmalloc(NULL, item_num * sizeof(*list), 0);
+ /* reserve one more memory slot for direction flag which may
+ * consume 1 lookup item.
+ */
+ list = rte_zmalloc(NULL, (item_num + 1) * sizeof(*list), 0);
if (!list) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
--
2.25.1
next reply other threads:[~2022-06-28 4:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 4:06 Yuying Zhang [this message]
2022-06-28 6:40 ` Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220628040651.755135-1-yuying.zhang@intel.com \
--to=yuying.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).