From: Corey Minyard <minyard@acm.org>
To: trix@redhat.com
Cc: nathan@kernel.org, ndesaulniers@google.com,
openipmi-developer@lists.sourceforge.net,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH] ipmi: initialize len variable
Date: Sun, 20 Mar 2022 12:37:47 -0500 [thread overview]
Message-ID: <20220320173747.GH3457@minyard.net> (raw)
In-Reply-To: <20220320135954.2258545-1-trix@redhat.com>
On Sun, Mar 20, 2022 at 06:59:54AM -0700, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.com>
>
> Clang static analysis reports this issue
> ipmi_ssif.c:1731:3: warning: 4th function call
> argument is an uninitialized value
> dev_info(&ssif_info->client->dev,
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> The 4th parameter is the 'len' variable.
> len is only set by a successful call to do_cmd().
> Initialize to len 0.
Thanks, it's queued for next release..
-corey
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> drivers/char/ipmi/ipmi_ssif.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
> index ba779f1abb5b2..f199cc1948446 100644
> --- a/drivers/char/ipmi/ipmi_ssif.c
> +++ b/drivers/char/ipmi/ipmi_ssif.c
> @@ -1625,7 +1625,7 @@ static int ssif_probe(struct i2c_client *client, const struct i2c_device_id *id)
> unsigned char *resp;
> struct ssif_info *ssif_info;
> int rv = 0;
> - int len;
> + int len = 0;
> int i;
> u8 slave_addr = 0;
> struct ssif_addr_info *addr_info = NULL;
> --
> 2.26.3
>
prev parent reply other threads:[~2022-03-20 17:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-20 13:59 [PATCH] ipmi: initialize len variable trix
2022-03-20 17:37 ` Corey Minyard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220320173747.GH3457@minyard.net \
--to=minyard@acm.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=trix@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox