From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Long Wu <long.wu@corigine.com>,
chaoyong.he@corigine.com, stable@dpdk.org,
Peng Zhang <peng.zhang@corigine.com>
Subject: [PATCH 1/2] net/nfp: fix receive function memory leak
Date: Mon, 11 Dec 2023 13:45:25 +0800 [thread overview]
Message-ID: <20231211054526.1701663-2-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20231211054526.1701663-1-chaoyong.he@corigine.com>
From: Long Wu <long.wu@corigine.com>
If the Rx ring is full and do not care its return value, this will
cause memory leak.
Fixes: 766d51c9ce29 ("net/nfp: merge receive function")
Cc: chaoyong.he@corigine.com
Cc: stable@dpdk.org
Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
drivers/net/nfp/flower/nfp_flower.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index f950ae233b..94b50611f0 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -133,7 +133,9 @@ nfp_flower_pf_dispatch_pkts(struct nfp_net_hw *hw,
return false;
}
- rte_ring_enqueue(repr->ring, (void *)mbuf);
+ if (rte_ring_enqueue(repr->ring, (void *)mbuf) != 0)
+ return false;
+
return true;
}
--
2.39.1
next prev parent reply other threads:[~2023-12-11 5:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-11 5:45 [PATCH 0/2] fix problem in Rx Chaoyong He
2023-12-11 5:45 ` Chaoyong He [this message]
2023-12-11 5:45 ` [PATCH 2/2] net/nfp: fix invalid Rx descriptor data Chaoyong He
2023-12-13 10:40 ` [PATCH 0/2] fix problem in Rx Ferruh Yigit
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=20231211054526.1701663-2-chaoyong.he@corigine.com \
--to=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=long.wu@corigine.com \
--cc=oss-drivers@corigine.com \
--cc=peng.zhang@corigine.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).