From 375f4a3b5a8fa599f9a3cfaced7bb72bef685068 Mon Sep 17 00:00:00 2001 From: Philippe De Swert Date: Tue, 23 Sep 2014 10:08:30 +0300 Subject: [PATCH] hostapd: Avoid dead code with P2P not enabled In case P2P is not enabled the if (dev_addr) is always ignored as dev_addr will be NULL. As this code is relevant only to P2P, it can be moved to be the ifdef to avoid static analyzer warnings. (CID 72907) Signed-off-by: Philippe De Swert --- src/ap/sta_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index 60f07682e..efd2a7243 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -956,12 +956,12 @@ void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta, dev_addr = addr; } else dev_addr = p2p_group_get_dev_addr(hapd->p2p_group, sta->addr); -#endif /* CONFIG_P2P */ if (dev_addr) os_snprintf(buf, sizeof(buf), MACSTR " p2p_dev_addr=" MACSTR, MAC2STR(sta->addr), MAC2STR(dev_addr)); else +#endif /* CONFIG_P2P */ os_snprintf(buf, sizeof(buf), MACSTR, MAC2STR(sta->addr)); if (authorized) {