lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 12 Feb 2014 14:22:59 +0900
From:	Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>
CC:	ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Toshi Kani <toshi.kani@...com>
Subject: Re: [PATCH] ACPI / container: Fix error code path in container_device_attach()

(2014/02/12 9:05), Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> To avoid leaking memory on errors from device_register(), do a
> put_device() on the device object in question in the error code
> path of container_device_attach().
>
> Fixes: caa73ea158de (ACPI / hotplug / driver core: Handle containers in a special way)
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---

Looks good to me.

Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>

Thanks,
Yasuaki Ishimatsu

>
> 3.14 material.
>
> Thanks!
>
> ---
>   drivers/acpi/container.c |    5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> Index: linux-pm/drivers/acpi/container.c
> ===================================================================
> --- linux-pm.orig/drivers/acpi/container.c
> +++ linux-pm/drivers/acpi/container.c
> @@ -82,9 +82,10 @@ static int container_device_attach(struc
>   	ACPI_COMPANION_SET(dev, adev);
>   	dev->release = acpi_container_release;
>   	ret = device_register(dev);
> -	if (ret)
> +	if (ret) {
> +		put_device(dev);
>   		return ret;
> -
> +	}
>   	adev->driver_data = dev;
>   	return 1;
>   }
>
> --
> 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/
>


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

Powered by Openwall GNU/*/Linux Powered by OpenVZ