ipmi_ssif: Fix uninitialized variable issue
PATCH 1/1 ipmi_ssif: Fix uninitialized variable issue
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")
return void")
--- drivers/char/ipmi/ipmi_ssif.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/char/ipmi/ipmi_ssif.c +1 -2
@@ -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,
Signature · 1 line
2.7.4
Quoted 4 lines · Gustavo A. R. Silva
Currently, function
ssif_removereturns _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
Quoted 29 lines
Addresses-Coverity-ID: 1467999 ("Uninitialized scalar variable")
Fixes 6a0d23ed338e ("ipmi: ipmi_unregister_smi() cannot fail, have itreturn void")
Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/char/ipmi/ipmi_ssif.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/char/ipmi/ipmi_ssif.c +1
-2@@ -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,
Quoted 8 lines · Corey Minyard
Quoted 4 lines · Gustavo A. R. Silva
Currently, function
ssif_removereturns _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