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: <abb7e045-2e8f-235f-1fde-2ea53258b45d@cogentembedded.com>
Date:   Tue, 18 Jul 2017 16:13:29 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:     Fabio Estevam <festevam@...il.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Fabio Estevam <fabio.estevam@....com>
Subject: Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

On 07/18/2017 04:09 PM, Fabio Estevam wrote:

>>    No, it does -- devm_gpiod_get_optinal() will return NULL in that case,
>> bus->reset_gpio will remanin NULL, and you're removing the NULL checks
>> around the gpiod_set_value_cansleep() calls. Perhaps it's the problem in the
>> GPIO support though...
>
> It is perfectly fine to call gpiod_set_value_cansleep() with a NULL
> gpio descriptor.

    Depends on whether CONFIG_HPIOLIB is enabled or not.

> Please take a look at drivers/gpio/gpiolib.c:

    If CONF(G_GPIOLIB=n, the stub from <linux/gpio/consumer.h gets used.
and devm_gpiod_get_optional() will return NULL in that case.

> gpiod_set_value_cansleep() calls VALIDATE_DESC_VOID
>
> Then if you look at the definition of VALIDATE_DESC_VOID you will see
> that it does a NULL check on desc and returns immediately if it is
> NULL.

    Sre, I did see that.

> This means we are safe here :-)

    Sigh...

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ