DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maayan Kashani <mkashani@nvidia.com>
To: Matan Azrad <matan@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Cc: <dev@dpdk.org>, Dariusz Sosnowski <dsosnowski@nvidia.com>,
	Maayan Kashani <mkashani@nvidia.com>, <stable@dpdk.org>
Subject: [PATCH 2/2] vdpa/mlx5: fix RQT attributes memory leak
Date: Sun, 25 Oct 2026 10:16:39 +0200	[thread overview]
Message-ID: <20261025081639.2746665-2-mkashani@nvidia.com> (raw)
In-Reply-To: <20261025081639.2746665-1-mkashani@nvidia.com>

mlx5_vdpa_rqt_prepare() allocates RQT attributes with rte_zmalloc() but
returns without freeing them when no enabled receive queue is found
(k == 0). Every steering update that hits this path leaks the
allocation.

Free attr before returning on the no-enabled-RQ path.

Fixes: 9f09b1ca15c5 ("vdpa/mlx5: recreate a virtq becoming enabled")
Cc: stable@dpdk.org

Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa_steer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_steer.c b/drivers/vdpa/mlx5/mlx5_vdpa_steer.c
index b1bca7f0f7d..5dd9ca40ebc 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_steer.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_steer.c
@@ -85,9 +85,11 @@ mlx5_vdpa_rqt_prepare(struct mlx5_vdpa_priv *priv, bool is_dummy)
 			k++;
 		}
 	}
-	if (k == 0)
+	if (k == 0) {
 		/* No enabled RQ to configure for RSS. */
+		rte_free(attr);
 		return 0;
+	}
 	num = (int)k;
 	for (j = 0; k != rqt_n; ++k, ++j)
 		attr->rq_list[k] = attr->rq_list[j];
-- 
2.25.1


      reply	other threads:[~2026-10-25  8:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25  8:16 [PATCH 1/2] vdpa/mlx5: fix RSS flow leak on steering update failure Maayan Kashani
2026-10-25  8:16 ` Maayan Kashani [this message]

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=20261025081639.2746665-2-mkashani@nvidia.com \
    --to=mkashani@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    /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