[Skiboot] [PATCH] fsp/fsp-chiptod: Fix uninitialized value

Kamalesh Babulal kamalesh at linux.vnet.ibm.com
Mon Jul 13 23:03:27 AEST 2015



On 07/13/2015 06:21 PM, Vasant Hegde wrote:
> On 07/13/2015 03:42 PM, Kamalesh Babulal wrote:
>> Initialized variable rc to 0, to fix uninitialized value
>> issue.
>>
>> Fixes Coverity defect#101857.
>>
>> Signed-off-by: Kamalesh Babulal <kamalesh at linux.vnet.ibm.com>
>> Cc: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>
>> ---
>>  hw/fsp/fsp-chiptod.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/fsp/fsp-chiptod.c b/hw/fsp/fsp-chiptod.c
>> index 69c59c6..ce7e9ce 100644
>> --- a/hw/fsp/fsp-chiptod.c
>> +++ b/hw/fsp/fsp-chiptod.c
>> @@ -27,7 +27,7 @@ static bool fsp_chiptod_update_topology(uint32_t cmd_sub_mod,
>>  	struct fsp_msg *resp;
>>  	enum chiptod_topology topo;
>>  	bool action;
>> -	uint8_t rc;
>> +	uint8_t rc = 0;
> Better rc = FSP_STATUS_SUCCESS;
>
Thanks for the review. I was under the assumption that
FSP_STATUS_SUCCESS was used
for value from read from (msg->resp->word1 >> 8) & 0xff. Given that
FSP_STATUS_SUCCESS
is also 0, is it ok to be used in this case also.

-- 
Cheers,
Kamalesh.



More information about the Skiboot mailing list