diff options
| author | Arif Hussain <arifhussain@codeaurora.org> | 2016-07-28 11:19:42 -0700 |
|---|---|---|
| committer | Vishwajith Upendra <vishwaji@codeaurora.org> | 2016-07-31 01:06:22 -0700 |
| commit | 174c3fcf46e4ade1da91e71d25599ebdb29c28f6 (patch) | |
| tree | 7700c23716cd05b5630e214f00da44dad308af10 | |
| parent | 49a5ffc904c4f55eb2d1dfef981d0ceb7f3d716a (diff) | |
qcacld-3.0: Avoid sending invalid frequency to ieee80211_frequency_to_channel
Avoid converting invalid frequency i.e zero frequency to channel using
ieee80211_frequency_to_channel() function.
Change-Id: I4a32591e313183348180a1d30a950b4b174a27cc
CRs-Fixed: 1047642
| -rw-r--r-- | core/hdd/src/wlan_hdd_hostapd.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 3a9882ba55c5..999144621acb 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -6436,12 +6436,15 @@ static int wlan_hdd_set_channel(struct wiphy *wiphy, */ channel = ieee80211_frequency_to_channel(chandef->chan->center_freq); + if (NL80211_CHAN_WIDTH_80P80 == chandef->width || - NL80211_CHAN_WIDTH_160 == chandef->width) - channel_seg2 = - ieee80211_frequency_to_channel(chandef->center_freq2); - else - channel_seg2 = 0; + NL80211_CHAN_WIDTH_160 == chandef->width) { + if (chandef->center_freq2) + channel_seg2 = ieee80211_frequency_to_channel( + chandef->center_freq2); + else + hdd_err("Invalid center_freq2"); + } /* Check freq range */ if ((WNI_CFG_CURRENT_CHANNEL_STAMIN > channel) || |
