Thermal/int340x/int3403: Fix memory leak
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tue, 23 Dec 2014 23:23:34 +0000 (15:23 -0800)
committerZhang Rui <rui.zhang@intel.com>
Wed, 24 Dec 2014 02:37:43 +0000 (10:37 +0800)
Address memory leak for buffer allocated with ACPI_ALLOCATE_BUFFER.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/int340x_thermal/int3403_thermal.c

index 1bfa6a6..479d754 100644 (file)
@@ -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;