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: <CAOMZO5BHDBR5y5q559UexTmYbhPwSp1MV3TJ3k+z4W8ehE-5_Q@mail.gmail.com>
Date:   Fri, 9 Jul 2021 00:36:25 -0300
From:   Fabio Estevam <festevam@...il.com>
To:     Souptick Joarder <jrdr.linux@...il.com>
Cc:     Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Sean Nyekjaer <sean@...nix.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        linux-iio@...r.kernel.org,
        linux-kernel <linux-kernel@...r.kernel.org>,
        kernel test robot <lkp@...el.com>,
        Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH] iio: accel: fxls8962af: Initialize return value

Hi Souptick,

On Fri, Jul 9, 2021 at 12:17 AM Souptick Joarder <jrdr.linux@...il.com> wrote:
>
> kernel test robot throws below warning ->
>
> smatch warnings:
> drivers/iio/accel/fxls8962af-core.c:640
> fxls8962af_i2c_raw_read_errata3() error: uninitialized symbol 'ret'.
>
> Initialize it.
>
> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> Signed-off-by: Souptick Joarder <jrdr.linux@...il.com>
> ---
>  drivers/iio/accel/fxls8962af-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c
> index 078d87865fde..8af1c8f58e83 100644
> --- a/drivers/iio/accel/fxls8962af-core.c
> +++ b/drivers/iio/accel/fxls8962af-core.c
> @@ -628,7 +628,7 @@ static int fxls8962af_i2c_raw_read_errata3(struct fxls8962af_data *data,
>                                            u16 *buffer, int samples,
>                                            int sample_length)
>  {
> -       int i, ret;
> +       int i, ret = -EINVAL;
>
>         for (i = 0; i < samples; i++) {
>                 ret = regmap_raw_read(data->regmap, FXLS8962AF_BUF_X_LSB,

Would the change below work?

--- a/drivers/iio/accel/fxls8962af-core.c
+++ b/drivers/iio/accel/fxls8962af-core.c
@@ -637,7 +637,7 @@ static int fxls8962af_i2c_raw_read_errata3(struct
fxls8962af_data *data,
                        return ret;
        }

-       return ret;
+       return 0;
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ