[PATCH] huawei: fix uninitialized variable issues
Aleksander Morgado
aleksander at lanedo.com
Wed Sep 4 22:36:30 PDT 2013
On 05/09/13 07:35, Aleksander Morgado wrote:
> On 05/09/13 00:31, Ben Chan wrote:
>> > This patch fixes the following uninitialized variable issues, which was
>> > introduced in the previous commit "huawei: retry connect/disconnect attempt
>> > upon ^NDISSTATQRY? failures" (commit 57c657bd066366db6892ac2a8adfec2ca209ccbe).
>> >
>> > huawei/mm-broadband-bearer-huawei.c:127:9: error: variable 'ipv4_available' is used uninitialized whenever '||' condition is true
>> > [-Werror,-Wsometimes-uninitialized]
>> > if (!response ||
>> > ^~~~~~~~~
>> > huawei/mm-broadband-bearer-huawei.c:141:9: note: uninitialized use occurs here
>> > if (ipv4_available && ipv4_connected) {
>> > ^~~~~~~~~~~~~~
>> > huawei/mm-broadband-bearer-huawei.c:127:9: note: remove the '||' if its condition is always false
>> > if (!response ||
>> > ^~~~~~~~~~~~
>> > huawei/mm-broadband-bearer-huawei.c:115:28: note: initialize the variable 'ipv4_available' to silence this warning
>> > gboolean ipv4_available;
>> > ^
>> > = 0
>> > huawei/mm-broadband-bearer-huawei.c:484:9: error: variable 'ipv4_available' is used uninitialized whenever '||' condition is true
>> > [-Werror,-Wsometimes-uninitialized]
>> > if (!response ||
>> > ^~~~~~~~~
>> > huawei/mm-broadband-bearer-huawei.c:498:9: note: uninitialized use occurs here
>> > if (ipv4_available && !ipv4_connected) {
>> > ^~~~~~~~~~~~~~
>> > huawei/mm-broadband-bearer-huawei.c:484:9: note: remove the '||' if its condition is always false
>> > if (!response ||
>> > ^~~~~~~~~~~~
>> > huawei/mm-broadband-bearer-huawei.c:472:28: note: initialize the variable 'ipv4_available' to silence this warning
>> > gboolean ipv4_available;
>> > ^
>> > = 0
>> > ---
> Oops; and this is my fault during the previous patch review :)
>
>
It's pushed to git; forgot to say.
--
Aleksander
More information about the ModemManager-devel
mailing list