patch 'dma/idxd: fix partial freeing in PCI close' has been queued to stable release 21.11.2

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Jul 6 22:35:02 CEST 2022


Hi,

FYI, your patch has been queued to stable release 21.11.2

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

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/5b7a2b5672104ae8d70e4dd403c48bfbba8dd703

Thanks.

Luca Boccassi

---
>From 5b7a2b5672104ae8d70e4dd403c48bfbba8dd703 Mon Sep 17 00:00:00 2001
From: Kevin Laatz <kevin.laatz at intel.com>
Date: Mon, 4 Jul 2022 16:27:50 +0100
Subject: [PATCH] dma/idxd: fix partial freeing in PCI close

[ upstream commit 1a57c8d553a022a282cc466712bf7f4ce6de20a4 ]

During PCI device close, any allocated memory needs to be free'd.
Currently, one of the free's is being called on an incorrect idxd_dmadev
struct member, namely 'batch_idx_ring'.

At device creation, memory is allocated for both 'batch_comp_ring' and
'batch_idx_ring' simultaneously. Calling free only on 'batch_idx_ring'
meant the first half of this memory was not being free'd, leading to the
memleak.

This patch fixes this memleak by calling free on 'batch_comp_ring' which
will free the memory for both rings.

Fixes: 9449330a8458 ("dma/idxd: create dmadev instances on PCI probe")

Signed-off-by: Kevin Laatz <kevin.laatz at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/dma/idxd/idxd_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/idxd/idxd_pci.c b/drivers/dma/idxd/idxd_pci.c
index fb618d34b6..2c3b01cd2b 100644
--- a/drivers/dma/idxd/idxd_pci.c
+++ b/drivers/dma/idxd/idxd_pci.c
@@ -130,7 +130,7 @@ idxd_pci_dev_close(struct rte_dma_dev *dev)
 
 	/* free device memory */
 	IDXD_PMD_DEBUG("Freeing device driver memory");
-	rte_free(idxd->batch_idx_ring);
+	rte_free(idxd->batch_comp_ring);
 	rte_free(idxd->desc_ring);
 
 	/* if this is the last WQ on the device, disable the device and free
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-07-06 21:07:54.494889492 +0100
+++ 0027-dma-idxd-fix-partial-freeing-in-PCI-close.patch	2022-07-06 21:07:53.579519398 +0100
@@ -1 +1 @@
-From 1a57c8d553a022a282cc466712bf7f4ce6de20a4 Mon Sep 17 00:00:00 2001
+From 5b7a2b5672104ae8d70e4dd403c48bfbba8dd703 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1a57c8d553a022a282cc466712bf7f4ce6de20a4 ]
+
@@ -19 +20,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list