Skip to content

Commit

Permalink
ipmi: initialize len variable
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Tom Rix <trix@redhat.com>
Message-Id: <20220320135954.2258545-1-trix@redhat.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
  • Loading branch information
Tom Rix authored and Corey Minyard committed Mar 20, 2022
1 parent f4676c8 commit 8d10ea1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/ipmi/ipmi_ssif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8d10ea1

Please sign in to comment.