* [PATCH] ipmi_ssif: Fix uninitialized variable issue
@ 2018-04-19 13:24 Gustavo A. R. Silva
2018-04-19 13:40 ` Corey Minyard
0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2018-04-19 13:24 UTC (permalink / raw)
To: Corey Minyard, Arnd Bergmann, Greg Kroah-Hartman
Cc: openipmi-developer, linux-kernel, Gustavo A. R. Silva
Currently, function ssif_remove returns _rv_, which is a variable that
is never initialized.
Fix this by removing variable _rv_ and return 0 instead.
Addresses-Coverity-ID: 1467999 ("Uninitialized scalar variable")
Fixes: 6a0d23ed338e ("ipmi: ipmi_unregister_smi() cannot fail, have it
return void")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/char/ipmi/ipmi_ssif.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
index ecabfe2..37f9ae2 100644
--- a/drivers/char/ipmi/ipmi_ssif.c
+++ b/drivers/char/ipmi/ipmi_ssif.c
@@ -1227,7 +1227,6 @@ static int ssif_remove(struct i2c_client *client)
struct ssif_info *ssif_info = i2c_get_clientdata(client);
struct ipmi_smi *intf;
struct ssif_addr_info *addr_info;
- int rv;
if (!ssif_info)
return 0;
@@ -1247,7 +1246,7 @@ static int ssif_remove(struct i2c_client *client)
}
}
- return rv;
+ return 0;
}
static int do_cmd(struct i2c_client *client, int len, unsigned char *msg,
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ipmi_ssif: Fix uninitialized variable issue
2018-04-19 13:24 [PATCH] ipmi_ssif: Fix uninitialized variable issue Gustavo A. R. Silva
@ 2018-04-19 13:40 ` Corey Minyard
2018-04-19 13:58 ` Gustavo A. R. Silva
0 siblings, 1 reply; 3+ messages in thread
From: Corey Minyard @ 2018-04-19 13:40 UTC (permalink / raw)
To: Gustavo A. R. Silva, Corey Minyard, Arnd Bergmann, Greg Kroah-Hartman
Cc: openipmi-developer, linux-kernel
On 04/19/2018 08:24 AM, Gustavo A. R. Silva wrote:
> Currently, function ssif_remove returns _rv_, which is a variable that
> is never initialized.
>
> Fix this by removing variable _rv_ and return 0 instead.
This fix is in my next tree now, thanks for catching this before it got
any further than that.
-corey
> Addresses-Coverity-ID: 1467999 ("Uninitialized scalar variable")
> Fixes: 6a0d23ed338e ("ipmi: ipmi_unregister_smi() cannot fail, have it
> return void")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> drivers/char/ipmi/ipmi_ssif.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
> index ecabfe2..37f9ae2 100644
> --- a/drivers/char/ipmi/ipmi_ssif.c
> +++ b/drivers/char/ipmi/ipmi_ssif.c
> @@ -1227,7 +1227,6 @@ static int ssif_remove(struct i2c_client *client)
> struct ssif_info *ssif_info = i2c_get_clientdata(client);
> struct ipmi_smi *intf;
> struct ssif_addr_info *addr_info;
> - int rv;
>
> if (!ssif_info)
> return 0;
> @@ -1247,7 +1246,7 @@ static int ssif_remove(struct i2c_client *client)
> }
> }
>
> - return rv;
> + return 0;
> }
>
> static int do_cmd(struct i2c_client *client, int len, unsigned char *msg,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ipmi_ssif: Fix uninitialized variable issue
2018-04-19 13:40 ` Corey Minyard
@ 2018-04-19 13:58 ` Gustavo A. R. Silva
0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2018-04-19 13:58 UTC (permalink / raw)
To: minyard, Corey Minyard, Arnd Bergmann, Greg Kroah-Hartman
Cc: openipmi-developer, linux-kernel
On 04/19/2018 08:40 AM, Corey Minyard wrote:
> On 04/19/2018 08:24 AM, Gustavo A. R. Silva wrote:
>> Currently, function ssif_remove returns _rv_, which is a variable that
>> is never initialized.
>>
>> Fix this by removing variable _rv_ and return 0 instead.
>
> This fix is in my next tree now, thanks for catching this before it got
> any further than that.
>
Glad to help. :)
Thanks
--
Gustavo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-19 13:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19 13:24 [PATCH] ipmi_ssif: Fix uninitialized variable issue Gustavo A. R. Silva
2018-04-19 13:40 ` Corey Minyard
2018-04-19 13:58 ` Gustavo A. R. Silva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).