Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1552009 > unrolled thread

[PATCH] ata: ahci_xgene: free structure returned by acpi_get_object_info()

Started byMichał Kępień <kernel@kempniu.pl>
First post2017-01-05 15:20 +0100
Last post2017-01-06 17:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ata: ahci_xgene: free structure returned by acpi_get_object_info() Michał Kępień <kernel@kempniu.pl> - 2017-01-05 15:20 +0100
    Re: [PATCH] ata: ahci_xgene: free structure returned by  acpi_get_object_info() Tejun Heo <tj@kernel.org> - 2017-01-06 17:50 +0100

#1552009 — [PATCH] ata: ahci_xgene: free structure returned by acpi_get_object_info()

FromMichał Kępień <kernel@kempniu.pl>
Date2017-01-05 15:20 +0100
Subject[PATCH] ata: ahci_xgene: free structure returned by acpi_get_object_info()
Message-ID<sWh3z-4bP-15@gated-at.bofh.it>
acpi_get_object_info() allocates the returned structure, which the
caller has to free when the call succeeds.  Free it when appropriate.

Fixes: c9802a4be661 ("ata: ahci_xgene: Add AHCI Support for 2nd HW version of APM X-Gene SoC AHCI SATA Host controller.")
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
---
 drivers/ata/ahci_xgene.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index 73b19b277138..c2b5941d9184 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -821,8 +821,10 @@ static int xgene_ahci_probe(struct platform_device *pdev)
 				dev_warn(&pdev->dev, "%s: Error reading device info. Assume version1\n",
 					__func__);
 				version = XGENE_AHCI_V1;
-			} else if (info->valid & ACPI_VALID_CID) {
-				version = XGENE_AHCI_V2;
+			} else {
+				if (info->valid & ACPI_VALID_CID)
+					version = XGENE_AHCI_V2;
+				kfree(info);
 			}
 		}
 	}
-- 
2.11.0

[toc] | [next] | [standalone]


#1552949 — Re: [PATCH] ata: ahci_xgene: free structure returned by acpi_get_object_info()

FromTejun Heo <tj@kernel.org>
Date2017-01-06 17:50 +0100
SubjectRe: [PATCH] ata: ahci_xgene: free structure returned by acpi_get_object_info()
Message-ID<sWFSh-4A4-5@gated-at.bofh.it>
In reply to#1552009
On Thu, Jan 05, 2017 at 03:14:01PM +0100, Michał Kępień wrote:
> acpi_get_object_info() allocates the returned structure, which the
> caller has to free when the call succeeds.  Free it when appropriate.
> 
> Fixes: c9802a4be661 ("ata: ahci_xgene: Add AHCI Support for 2nd HW version of APM X-Gene SoC AHCI SATA Host controller.")
> Signed-off-by: Michał Kępień <kernel@kempniu.pl>

Applied to libata/for-4.11.

Thanks.

-- 
tejun

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web