lkml.org 
[lkml]   [2010]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] drivers/acpi/power_meter.c : remove double kfree()
    On Tue, Jan 12, 2010 at 11:37:07PM +1100, Darren Jenkins wrote:
    > 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@gmail.com>

    Thanks for catching this.

    Acked-by: Darrick J. Wong <djwong@us.ibm.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;
    > }
    >
    >


    \
     
     \ /
      Last update: 2010-01-13 20:33    [W:0.021 / U:1.152 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site