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: <d45a52e356766b6f90122e75d53089cd17a0e9d3.camel@pengutronix.de>
Date:   Wed, 06 Dec 2023 15:35:55 +0100
From:   Philipp Zabel <p.zabel@...gutronix.de>
To:     Rouven Czerwinski <r.czerwinski@...gutronix.de>,
        Johannes Berg <johannes@...solutions.net>,
        Josua Mayer <josua@...id-run.com>,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     stable@...r.kernel.org, Eric Dumazet <edumazet@...gle.com>,
        kernel@...gutronix.de, Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        "David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH] net: rfkill: gpio: set GPIO direction

Hi Rouven,

On Mi, 2023-12-06 at 14:24 +0100, Rouven Czerwinski wrote:
> Hi Johannes,
> 
> On Wed, 2023-12-06 at 14:16 +0100, Johannes Berg wrote:
> > On Wed, 2023-12-06 at 14:13 +0100, Rouven Czerwinski wrote:
> > > 
> > > +++ b/net/rfkill/rfkill-gpio.c
> > > @@ -126,6 +126,16 @@ static int rfkill_gpio_probe(struct
> > > platform_device *pdev)
> > >  		return -EINVAL;
> > >  	}
> > >  
> > > +	if (rfkill->reset_gpio)
> > > +		ret = gpiod_direction_output(rfkill->reset_gpio,
> > > true);
> > > +	if (ret)
> > > +		return ret;
> > > +
> > > +	if (rfkill->shutdown_gpio)
> > > +		ret = gpiod_direction_output(rfkill-
> > > > shutdown_gpio, true);
> > > +	if (ret)
> > > +		return ret;
> > > 
> > 
> > That's weird, you need ret to be inside the if. It's even entirely
> > uninitialized if you don't have ACPI, if you don't have
> > reset/shutdown.
> 
> Thanks for the review, you are totally right, I didn't look at the ret
> initialization. I moved it inside the if for v2.

The if-block is not required at all, gpiod_direction_output(NULL, ...)
will just return 0 from VALIDATE_DESC().

regards
Philipp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ