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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAA7nrthjap=s1PMgN3=hzvxzgPNruO=X-XxJdDDWu75mOXtR3g@mail.gmail.com>
Date:	Thu, 16 Apr 2015 10:25:44 +0530
From:	rajeev kumar <rajeevkumar.linux@...il.com>
To:	Alan Stern <stern@...land.harvard.edu>
Cc:	Arun Ramamurthy <arun.ramamurthy@...adcom.com>,
	Kishon Vijay Abraham I <kishon@...com>,
	Tony Prisk <linux@...sktech.co.nz>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Arnd Bergmann <arnd@...db.de>, Felipe Balbi <balbi@...com>,
	Mathias Nyman <mathias.nyman@...ux.intel.com>,
	Paul Bolle <pebolle@...cali.nl>,
	Thomas Pugliese <thomas.pugliese@...il.com>,
	Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
	David Mosberger <davidm@...uge.net>,
	Peter Griffin <peter.griffin@...aro.org>,
	Gregory CLEMENT <gregory.clement@...e-electrons.com>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Kevin Hao <haokexin@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>, linux-usb@...r.kernel.org,
	Dmitry Torokhov <dtor@...gle.com>,
	Anatol Pomazau <anatol@...gle.com>,
	Jonathan Richardson <jonathar@...adcom.com>,
	Scott Branden <sbranden@...adcom.com>,
	Ray Jui <rjui@...adcom.com>,
	bcm-kernel-feedback-list@...adcom.com
Subject: Re: [PATCHv2 2/3] usb: ehci-platform: Use devm_of_phy_get_by_index

On Wed, Apr 15, 2015 at 8:06 PM, Alan Stern <stern@...land.harvard.edu> wrote:
> On Wed, 15 Apr 2015, rajeev kumar wrote:
>
>> > @@ -88,15 +88,13 @@ static int ehci_platform_power_on(struct platform_device *dev)
>> >         }
>> >
>> >         for (phy_num = 0; phy_num < priv->num_phys; phy_num++) {
>> > -               if (priv->phys[phy_num]) {
>> > -                       ret = phy_init(priv->phys[phy_num]);
>> > -                       if (ret)
>> > -                               goto err_exit_phy;
>> > -                       ret = phy_power_on(priv->phys[phy_num]);
>> > -                       if (ret) {
>> > -                               phy_exit(priv->phys[phy_num]);
>> > -                               goto err_exit_phy;
>> > -                       }
>> > +               ret = phy_init(priv->phys[phy_num]);
>> > +               if (ret)
>> > +                       goto err_exit_phy;
>>
>> Jumping to err_exit_phy will perform phy_power_off also which is not
>> required as you are are powering on after phy_init. Wrong level
>> jumping
>
> Look again, and this time pay more attention to the value of phy_num.
>
> Alan Stern

MIssed it ,  Thanks for the pointer.

~Rajeev

>
>> ~Rajeev
>>
>> > +               ret = phy_power_on(priv->phys[phy_num]);
>> > +               if (ret) {
>> > +                       phy_exit(priv->phys[phy_num]);
>> > +                       goto err_exit_phy;
>> >                 }
>> >         }
>> >
>> > @@ -104,10 +102,8 @@ static int ehci_platform_power_on(struct platform_device *dev)
>> >
>> >  err_exit_phy:
>> >         while (--phy_num >= 0) {
>> > -               if (priv->phys[phy_num]) {
>> > -                       phy_power_off(priv->phys[phy_num]);
>> > -                       phy_exit(priv->phys[phy_num]);
>> > -               }
>> > +               phy_power_off(priv->phys[phy_num]);
>> > +               phy_exit(priv->phys[phy_num]);
>> >         }
>
>
--
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