From: Srinivas Pandruvada Date: Tue, 23 Dec 2014 23:23:34 +0000 (-0800) Subject: Thermal/int340x/int3403: Fix memory leak X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f01bc8f37ec940caae8bf8b6e7169f7cc2b6877a;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Thermal/int340x/int3403: Fix memory leak Address memory leak for buffer allocated with ACPI_ALLOCATE_BUFFER. Signed-off-by: Srinivas Pandruvada Signed-off-by: Zhang Rui --- diff --git a/drivers/thermal/int340x_thermal/int3403_thermal.c b/drivers/thermal/int340x_thermal/int3403_thermal.c index 1bfa6a69e77a..479d754c3f57 100644 --- a/drivers/thermal/int340x_thermal/int3403_thermal.c +++ b/drivers/thermal/int340x_thermal/int3403_thermal.c @@ -369,6 +369,7 @@ static int int3403_cdev_add(struct int3403_priv *priv) p = buf.pointer; if (!p || (p->type != ACPI_TYPE_PACKAGE)) { printk(KERN_WARNING "Invalid PPSS data\n"); + kfree(buf.pointer); return -EFAULT; } @@ -381,6 +382,7 @@ static int int3403_cdev_add(struct int3403_priv *priv) priv->priv = obj; + kfree(buf.pointer); /* TODO: add ACPI notification support */ return result;