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: <20130725171951.GD25415@radagast>
Date:	Thu, 25 Jul 2013 20:19:51 +0300
From:	Felipe Balbi <balbi@...com>
To:	Olof Johansson <olof@...om.net>
CC:	Felipe Balbi <balbi@...com>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb: gadget: at91_udc: Check gpio lookup results

On Thu, Jul 25, 2013 at 09:18:39AM -0700, Olof Johansson wrote:
> On Thu, Jul 25, 2013 at 9:14 AM, Felipe Balbi <balbi@...com> wrote:
> > Hi,
> >
> > On Tue, Jul 23, 2013 at 11:55:50AM -0700, Olof Johansson wrote:
> >> This resolves the following valid build warning:
> >>
> >> drivers/usb/gadget/at91_udc.c:1685:34: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
> >>
> >> I switched from ? : to !! mostly to save from wrapping the lines while
> >> I was at it.
> >>
> >> Signed-off-by: Olof Johansson <olof@...om.net>
> >> ---
> >>
> >> Felipe, this would be nice to see fixed for 3.11 but I'd argue that it's
> >> been here long enough to not really be needed for -stable.
> >>
> >>  drivers/usb/gadget/at91_udc.c |   12 ++++++++++--
> >>  1 file changed, 10 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
> >> index 073b938..f3dbcd0 100644
> >> --- a/drivers/usb/gadget/at91_udc.c
> >> +++ b/drivers/usb/gadget/at91_udc.c
> >> @@ -1682,12 +1682,20 @@ static void at91udc_of_init(struct at91_udc *udc,
> >>
> >>       board->vbus_pin = of_get_named_gpio_flags(np, "atmel,vbus-gpio", 0,
> >>                                                 &flags);
> >> -     board->vbus_active_low = (flags & OF_GPIO_ACTIVE_LOW) ? 1 : 0;
> >> +     if (board->vbus_pin < 0)
> >> +             pr_err("%s: Failed to get atmel,vbus-gpio property\n",
> >> +                    np->full_name);
> >> +     else
> >> +             board->vbus_active_low = !!(flags & OF_GPIO_ACTIVE_LOW);
> >
> > should you even continue if you can't get the gpio ? If this gpio is
> > optional, then it's not really and error, rather a debugging or
> > informational message.
> 
> That's what the code does today, and I wasn't trying to second-guess
> their decisions on that. Chances are firmware, in some instances, have
> left power on so continuing might do no harm.

fair enough, then let's just decrease the error message level to debug
or info.

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ