Re: [PATCH] drivers/acpi/power_meter.c : remove double kfree()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 

Thanks for catching this.

Acked-by: Darrick J. Wong <djwong@xxxxxxxxxx>

> 
> 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-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux