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]
Message-Id: <201208052350.10113.heiko@sntech.de>
Date:	Sun, 5 Aug 2012 23:50:09 +0200
From:	Heiko Stübner <heiko@...ech.de>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
	"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PM / Domains: Only check for errors when calling dev_pm_get_subsys_data

Am Sonntag, 5. August 2012, 23:13:46 schrieb Rafael J. Wysocki:
> On Sunday, August 05, 2012, Heiko Stübner wrote:
> > Commit 1d5fcfec22 (PM / Domains: Add device domain data reference
> > counter) added a check for the return value of dev_pm_get_subsys_data.
> > 
> > But this function does not only return error codes but also "1" when a
> > new object has been created.
> > 
> > So, change the check to only catch real errors.
> > 
> > Signed-off-by: Heiko Stuebner <heiko@...ech.de>
> 
> Good catch!

it bit me while moving to 3.6-rc1 with my machine support - suddenly my usbphy 
didn't turn on again :-)

 
> Applied to the linux-next branch of the linux-pm.git tree.  I'm going to
> push it as a fix for v3.6.
> 
> However, there's one more analogous fix necessary, for which I'm going to
> apply the appended patch.

Sorry :-) - I did only check the rest of 1d5fcfec22 for more of this, but not 
the whole domain.c. The second occurence seems to have been introduced by 
62d4490294.


Heiko

> Thanks,
> Rafael
> 
> 
> ---
> From: Rafael J. Wysocki <rjw@...k.pl>
> Subject: PM / Domains: Fix one more dev_pm_get_subsys_data() return value
> check
> 
> The check agains the return value of dev_pm_get_subsys_data()
> in pm_genpd_add_callbacks() should be modified so that non-negative
> values are not regarded as errors, because dev_pm_get_subsys_data()
> returns 1 if it successfully creates a new object.
> 
> Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>
> ---
>  drivers/base/power/domain.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux/drivers/base/power/domain.c
> ===================================================================
> --- linux.orig/drivers/base/power/domain.c
> +++ linux/drivers/base/power/domain.c
> @@ -1691,7 +1691,7 @@ int pm_genpd_add_callbacks(struct device
>  	device_pm_lock();
> 
>  	ret = dev_pm_get_subsys_data(dev);
> -	if (ret)
> +	if (ret < 0)
>  		goto out;
> 
>  	spin_lock_irq(&dev->power.lock);

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