Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d64d373f authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

nl80211: fix compiler warning



John reported the following warning:

net/wireless/nl80211.c: In function ‘nl80211_tx_mgmt’:
net/wireless/nl80211.c:5286:8: warning: ‘hdr’ may be used uninitialized in this function

Evidently, his version of gcc isn't able to see that
when "msg" is initialized, "hdr" must also be. My
gcc, 4.6.1, can actually see that and doesn't warn.
Simply initialize the variable to NULL. That means
if the compiler was ever right we'll crash though so
isn't really optimal since it may hide warnings from
the compiler when somebody modifies this code in the
future.

Reported-by: default avatarJohn Linville <linville@tuxdriver.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e0830f71
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment