[RFC] hostapd: Fix pointer assignment for new iface alloc
Mohammed Shafi Shajakhan
mohammed
Thu May 16 07:44:08 PDT 2013
From: Mohammed Shafi Shajakhan <mohammed at qca.qualcomm.com>
interface count has to be increment, otherwise the previous interfaces
per-interface data structure maintained inside 'hapd_interfaces'
is over-written.
Signed-hostap: Mohammed Shafi Shajakhan <mohammed at qca.qualcomm.com>
---
src/ap/hostapd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index a0ac38c..e04d498 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -1185,6 +1185,7 @@ hostapd_iface_alloc(struct hapd_interfaces *interfaces)
if (iface == NULL)
return NULL;
interfaces->iface = iface;
+ interfaces->count++;
hapd_iface = interfaces->iface[interfaces->count] =
os_zalloc(sizeof(*hapd_iface));
if (hapd_iface == NULL) {
@@ -1192,7 +1193,6 @@ hostapd_iface_alloc(struct hapd_interfaces *interfaces)
"the interface", __func__);
return NULL;
}
- interfaces->count++;
hapd_iface->interfaces = interfaces;
return hapd_iface;
--
1.7.9.5
More information about the Hostap
mailing list