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: <bd4ff961-37b8-607b-e801-bff37d0eb452@amd.com>
Date:   Fri, 17 Jun 2022 08:02:26 +0200
From:   Michal Simek <michal.simek@....com>
To:     Srinivas Neeli <srinivas.neeli@...inx.com>,
        <linus.walleij@...aro.org>, <brgl@...ev.pl>,
        <bgolaszewski@...libre.com>, <michal.simek@...inx.com>,
        <neelisrinivas18@...il.com>, <shubhrajyoti.datta@...inx.com>,
        <srinivas.neeli@....com>, <sgoud@...inx.com>
CC:     <linux-gpio@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <git@...inx.com>
Subject: Re: [PATCH] gpio: gpio-xilinx: Check return value of
 of_property_read_u32



On 6/17/22 07:19, Srinivas Neeli wrote:
> In five different instances the return value of "of_property_read_u32"
> API was neither captured nor checked.
> 
> Fixed it by capturing the return value and then checking for any error.
> 
> Signed-off-by: Srinivas Neeli <srinivas.neeli@...inx.com>
> Addresses-Coverity: "check_return"
> ---
>   drivers/gpio/gpio-xilinx.c | 15 ++++++++++-----
>   1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
> index b6d3a57e27ed..268c7b0e481d 100644
> --- a/drivers/gpio/gpio-xilinx.c
> +++ b/drivers/gpio/gpio-xilinx.c
> @@ -570,7 +570,8 @@ static int xgpio_probe(struct platform_device *pdev)
>   	platform_set_drvdata(pdev, chip);
>   
>   	/* First, check if the device is dual-channel */
> -	of_property_read_u32(np, "xlnx,is-dual", &is_dual);
> +	if (of_property_read_u32(np, "xlnx,is-dual", &is_dual))
> +		is_dual = 0;

All these values are initialized already.
Isn't it enough to just ignore return value like this to make coverity happy?

(void)of_property_read_u32(np, "xlnx,is-dual", &is_dual)

Thanks,
Michal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ