diff mbox series

dmaengine: acpi: Put the CSRT table after using it

Message ID 1595411661-15936-1-git-send-email-guohanjun@huawei.com (mailing list archive)
State Accepted
Headers show
Series dmaengine: acpi: Put the CSRT table after using it | expand

Commit Message

Hanjun Guo July 22, 2020, 9:54 a.m. UTC
The acpi_get_table() should be coupled with acpi_put_table() if
the mapped table is not used at runtime to release the table
mapping, put the CSRT table buf after using it.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
 drivers/dma/acpi-dma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Vinod Koul Aug. 17, 2020, 4:51 a.m. UTC | #1
On 22-07-20, 17:54, Hanjun Guo wrote:
> The acpi_get_table() should be coupled with acpi_put_table() if
> the mapped table is not used at runtime to release the table
> mapping, put the CSRT table buf after using it.

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c
index 8a05db3..dcbcb71 100644
--- a/drivers/dma/acpi-dma.c
+++ b/drivers/dma/acpi-dma.c
@@ -135,11 +135,13 @@  static void acpi_dma_parse_csrt(struct acpi_device *adev, struct acpi_dma *adma)
 		if (ret < 0) {
 			dev_warn(&adev->dev,
 				 "error in parsing resource group\n");
-			return;
+			break;
 		}
 
 		grp = (struct acpi_csrt_group *)((void *)grp + grp->length);
 	}
+
+	acpi_put_table((struct acpi_table_header *)csrt);
 }
 
 /**