ipmi: initialize len variable
authorTom Rix <trix@redhat.com>
Sun, 20 Mar 2022 13:59:54 +0000 (06:59 -0700)
committerCorey Minyard <cminyard@mvista.com>
Sun, 20 Mar 2022 17:37:15 +0000 (12:37 -0500)
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>
drivers/char/ipmi/ipmi_ssif.c

index ba779f1abb5b2a9044e14f0c996e09823dd61b46..f199cc19484462ba020adfd820ff4510e791a73f 100644 (file)
@@ -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;