wlan: Protect cfg80211 netdev ops and wext ioctls from SSR
Protect cfg80211, netdev ops functions and hostapd, wext ioctls from
accessing uninitialized or de-allocated data structures while SSR is
in progress.
Change-Id: I0c41da99ac245ed8b5580246f3e79f3a02ba2051
CRs-Fixed: 772343
diff --git a/CORE/HDD/src/wlan_hdd_softap_tx_rx.c b/CORE/HDD/src/wlan_hdd_softap_tx_rx.c
index a2fa7a1..ee4fa40 100644
--- a/CORE/HDD/src/wlan_hdd_softap_tx_rx.c
+++ b/CORE/HDD/src/wlan_hdd_softap_tx_rx.c
@@ -49,6 +49,7 @@
#include <linux/etherdevice.h>
//#include <vos_list.h>
#include <vos_types.h>
+#include <vos_sched.h>
#include <aniGlobal.h>
#include <halTypes.h>
#include <net/ieee80211_radiotap.h>
@@ -666,14 +667,14 @@
}
/**============================================================================
- @brief hdd_softap_tx_timeout() - Function called by OS if there is any
+ @brief __hdd_softap_tx_timeout() - Function called by OS if there is any
timeout during transmission. Since HDD simply enqueues packet
and returns control to OS right away, this would never be invoked
@param dev : [in] pointer to Libra network device
@return : None
===========================================================================*/
-void hdd_softap_tx_timeout(struct net_device *dev)
+void __hdd_softap_tx_timeout(struct net_device *dev)
{
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
struct netdev_queue *txq;
@@ -736,21 +737,37 @@
}
+void hdd_softap_tx_timeout(struct net_device *dev)
+{
+ vos_ssr_protect(__func__);
+ __hdd_softap_tx_timeout(dev);
+ vos_ssr_unprotect(__func__);
+ return;
+}
/**============================================================================
- @brief hdd_softap_stats() - Function registered with the Linux OS for
+ @brief __hdd_softap_stats() - Function registered with the Linux OS for
device TX/RX statistic
@param dev : [in] pointer to Libra network device
@return : pointer to net_device_stats structure
===========================================================================*/
-struct net_device_stats* hdd_softap_stats(struct net_device *dev)
+struct net_device_stats* __hdd_softap_stats(struct net_device *dev)
{
hdd_adapter_t* priv = netdev_priv(dev);
return &priv->stats;
}
+struct net_device_stats* hdd_softap_stats(struct net_device *dev)
+{
+ struct net_device_stats *priv_stats;
+ vos_ssr_protect(__func__);
+ priv_stats = __hdd_softap_stats(dev);
+ vos_ssr_unprotect(__func__);
+
+ return priv_stats;
+}
/**============================================================================
@brief hdd_softap_init_tx_rx() - Init function to initialize Tx/RX