[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1263299827.4571.11.camel@ICE-BOX>
Date: Tue, 12 Jan 2010 23:37:07 +1100
From: Darren Jenkins <darrenrjenkins@...il.com>
To: djwong@...ibm.com, lenb@...nel.org, linux-acpi@...r.kernel.org,
Kernel Janitors <kernel-janitors@...r.kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH] drivers/acpi/power_meter.c : remove double kfree()
resource->domain_devices can be double kfree()'d in a couple of places.
Fix this by setting num_domain_devices = 0 after the kfree().
Coverity CID: 13356, 13355, 13354
Signed-off-by: Darren Jenkins <darrenrjenkins@...il.com>
diff --git drivers/acpi/power_meter.c drivers/acpi/power_meter.c
index 2ef7030..18ce00a 100644
--- drivers/acpi/power_meter.c
+++ drivers/acpi/power_meter.c
@@ -534,6 +534,7 @@ static void remove_domain_devices(struct acpi_power_meter_resource *resource)
kfree(resource->domain_devices);
kobject_put(resource->holders_dir);
+ resource->num_domain_devices = 0;
}
static int read_domain_devices(struct acpi_power_meter_resource *resource)
@@ -740,7 +741,6 @@ skip_unsafe_cap:
return res;
error:
- remove_domain_devices(resource);
remove_attrs(resource);
return res;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists