]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
Silence uninitialized variable warning
authorJoe Korty <joe.korty@ccur.com>
Wed, 25 May 2016 12:58:56 +0000 (18:28 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Sun, 17 Jul 2016 21:00:03 +0000 (14:00 -0700)
When we go through the switch() case
where 'send_direct' is not initialized, the
code later on that uses 'send_direct' will
be skipped over.  So it is safe to set this
'send_direct' to any value we want in order
to quiet this gcc warning.

net/mac80211/cfg.c: In function 'ieee80211_tdls_mgmt':
net/mac80211/cfg.c:3225:5: warning:
'send_direct' may be used uninitialized in this
function [-Wmaybe-uninitialized]
if (send_direct) {

Bug 200187768

Change-Id: I01128d4682898b01e0512881029497821bc93201
Signed-off-by: Joe Korty <joe.korty@ccur.com>
Signed-off-by: Gaurav Singh <gaursingh@nvidia.com>
Reviewed-on: http://git-master/r/1163942
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
net/mac80211/cfg.c

index e922bf3f422c974698fec987332db4cd78563851..a06ad19cb83ccd476aa60c29bd770d97cf279ac8 100644 (file)
@@ -3147,7 +3147,7 @@ static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
        struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
        struct ieee80211_local *local = sdata->local;
        struct sk_buff *skb = NULL;
-       bool send_direct;
+       bool send_direct = false;
        int ret;
 
        if (!(wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS))