]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
bcmdhd: fix NULL pointer in setting IEs
authorAllen Yu <alleny@nvidia.com>
Sun, 6 Jul 2014 12:10:15 +0000 (20:10 +0800)
committerChas Inman <chasi@nvidia.com>
Sun, 6 Jul 2014 22:13:02 +0000 (15:13 -0700)
In case of device role undetermined, we should return error instread of
going ahead to set IEs to FW, which could potentially cause a NULL poiter
issue.

Bug 200015171

Change-Id: I2dd1828d6ad87845d3b0ed5bfeaffad6fe728a1f
Signed-off-by: Allen Yu <alleny@nvidia.com>
Reviewed-on: http://git-master/r/434900
Reviewed-by: Robert Shih <rshih@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-by: Kevin Bruckert <kbruckert@nvidia.com>
Tested-by: Kevin Bruckert <kbruckert@nvidia.com>
Reviewed-by: Chas Inman <chasi@nvidia.com>
drivers/net/wireless/bcmdhd/wl_cfg80211.c

index 6cfc293c13db51feb27f03457fc54521143e2633..5baaf63c71476515b6a84de04e0f8253410a8e29 100644 (file)
@@ -6278,6 +6278,12 @@ wl_cfg80211_change_beacon(
                dev_role = NL80211_IFTYPE_P2P_GO;
        }
 
+       if (dev_role == 0) {
+               WL_ERR(("Unknown device role!\n"));
+               err = BCME_ERROR;
+               goto fail;
+       }
+
        if (!check_dev_role_integrity(wl, dev_role))
                goto fail;
 
@@ -6349,6 +6355,12 @@ wl_cfg80211_add_set_beacon(struct wiphy *wiphy, struct net_device *dev,
                dev_role = NL80211_IFTYPE_P2P_GO;
        }
 
+       if (dev_role == 0) {
+               WL_ERR(("Unknown device role!\n"));
+               err = BCME_ERROR;
+               goto fail;
+       }
+
        if (!check_dev_role_integrity(wl, dev_role))
                goto fail;