diff mbox

Remove duplicated center_freq init

Message ID 1455617769-15067-1-git-send-email-eabinader@ocedo.com
State Changes Requested
Headers show

Commit Message

Eduardo Abinader Feb. 16, 2016, 10:16 a.m. UTC
From: Eduardo Abinader <eabinader@ocedo.com>

As the center freq values are adjusted in a proper
function, dfs_adjust_vht_center_freq, just ensure
there is no duplicated code for that.

Signed-off-by: Eduardo Abinader <eabinader@ocedo.com>
---
 src/ap/dfs.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Jouni Malinen Feb. 18, 2016, 3:58 p.m. UTC | #1
On Tue, Feb 16, 2016 at 11:16:09AM +0100, eabinader@ocedo.com wrote:
> As the center freq values are adjusted in a proper
> function, dfs_adjust_vht_center_freq, just ensure
> there is no duplicated code for that.

Could you please clarify where these values are set in all possible code
paths? As far as I can tell, there are possible cases where it is far
from obvious that these get initialized. As such, I'd much rather leave
these here in dfs_get_valid_channel() to avoid getting uninitialized
values. It looks like much less work to do what is done currently rather
than go through each possible code path and add similar clearing to
places where it may be currently missing.
diff mbox

Patch

diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index 7273caa..43f1764 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -434,8 +434,6 @@  dfs_get_valid_channel(struct hostapd_iface *iface,
 
 	wpa_printf(MSG_DEBUG, "DFS: Selecting random channel");
 	*secondary_channel = 0;
-	*vht_oper_centr_freq_seg0_idx = 0;
-	*vht_oper_centr_freq_seg1_idx = 0;
 
 	if (iface->current_mode == NULL)
 		return NULL;