Search Linux Wireless

Re: [PATCH] Fix uninitialized-variable warnings.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Joe's patch (the 1-line fix) does not work for me. The assignment
is in a conditional block, when refer to this ofdm_index_old later, I
still get error -

/mnt/host/source/src/third_party/kernel/files/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:771:31:
error: 'ofdm_index_old[1]' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
     rtlpriv->dm.ofdm_index[i] = ofdm_index_old[i];

(I'm working on 3.4 branch.)

Thanks,

On Thu, Apr 11, 2013 at 1:00 PM, Larry Finger <Larry.Finger@xxxxxxxxxxxx> wrote:
> On 04/11/2013 01:35 PM, Joe Perches wrote:
>>
>> On Thu, 2013-04-11 at 11:02 -0700, Han Shen wrote:
>>>
>>> GCC 4.8 is spitting out uninitialized-varaible warnings against
>>> "drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c".
>>> This trivial patch just adds initialization to the variable.
>>
>>
>> Not sure this is correct.
>> I think the logic should be inspected instead.
>>
>> ofdm_index_old[1] _is_ used uninitialized.
>>
>> It appears there might be a missing
>>
>>         ofdm_index_old[1] = (u8) i;
>>
>> as that's the same style test done in the
>> section above.
>>
>> Maybe this:
>> ---
>>   drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
>> b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
>> index b793a65..56b2b2f 100644
>> --- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
>> +++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
>> @@ -717,6 +717,7 @@ static void
>> rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
>>                         for (i = 0; i < OFDM_TABLE_LENGTH; i++) {
>>                                 if (ele_d == (ofdmswing_table[i] &
>>                                     MASKOFDM_D)) {
>> +                                       ofdm_index_old[1] = (u8) i;
>>
>>                                         RT_TRACE(rtlpriv,
>> COMP_POWER_TRACKING,
>>                                                  DBG_LOUD,
>
>
> My earlier E-mail was too hasty. Joe's patch is correct. It should be marked
> for stable (2.6.39+).
>
> Larry
>
>
>



-- 
Han Shen |  Software Engineer |  shenhan@xxxxxxxxxx |  +1-650-440-3330
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux