diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 7bf068cce956..a9b3084ca2d2 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -3861,7 +3861,6 @@ int wlan_hdd_set_channel(struct wiphy *wiphy, { struct hdd_adapter *adapter = NULL; uint32_t num_ch = 0; - int channel = 0; int channel_seg2 = 0; struct hdd_context *hdd_ctx; int status; @@ -3900,7 +3899,6 @@ int wlan_hdd_set_channel(struct wiphy *wiphy, return -EINVAL; } - channel = ieee80211_frequency_to_channel(chandef->chan->center_freq); if (NL80211_CHAN_WIDTH_80P80 == chandef->width) { if ((wlan_reg_min_chan_freq() > chandef->center_freq2) || @@ -3920,8 +3918,8 @@ int wlan_hdd_set_channel(struct wiphy *wiphy, num_ch = CFG_VALID_CHANNEL_LIST_LEN; if (QDF_STATUS_SUCCESS != wlan_hdd_validate_operation_channel( - adapter, wlan_reg_chan_to_freq(hdd_ctx->pdev, channel))) { - hdd_err("Invalid Channel: %d", channel); + adapter, chandef->chan->center_freq)) { + hdd_err("Invalid freq: %d", chandef->chan->center_freq); return -EINVAL; }