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: <CACKFLin=rgt7EyWJ-P5jhkAQR5NweCWp-5AZN=FoH+AGpVNZWw@mail.gmail.com>
Date:   Tue, 18 Sep 2018 00:02:06 -0700
From:   Michael Chan <michael.chan@...adcom.com>
To:     zhong jiang <zhongjiang@...wei.com>
Cc:     David Miller <davem@...emloft.net>,
        Vasundhara Volam <vasundhara-v.volam@...adcom.com>,
        Netdev <netdev@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] net: bnxt: Fix a uninitialized variable warning.

On Mon, Sep 17, 2018 at 9:55 PM, zhong jiang <zhongjiang@...wei.com> wrote:
> Fix the following compile warning:
>
> drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c:49:5: warning: ‘nvm_param.dir_type’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   if (nvm_param.dir_type == BNXT_NVM_PORT_CFG)
>
> Signed-off-by: zhong jiang <zhongjiang@...wei.com>
> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
> index f3b9fbc..1ae56fc 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
> @@ -46,6 +46,9 @@ static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param_id, void *msg,
>                 }
>         }
>
> +       if (i == ARRAY_SIZE(nvm_params))
> +               return -EINVAL;
> +

-EOPNOTSUPP might be a better return code.  Other than that, it looks
good to me.  Thanks.

>         if (nvm_param.dir_type == BNXT_NVM_PORT_CFG)
>                 idx = bp->pf.port_id;
>         else if (nvm_param.dir_type == BNXT_NVM_FUNC_CFG)
> --
> 1.7.12.4
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ