From 7a65740e470c3e3ccd80940dd7b5aee1743ce8a3 Mon Sep 17 00:00:00 2001 From: Hanumanth Reddy Pothula Date: Wed, 7 Sep 2016 20:59:18 +0530 Subject: [PATCH] qcacld-3.0: Unregister wext interface, on STA interface down Host registers wext handlers, during STA interface UP. But not unregistering during interface down, lending user to issue iwpriv commands though interface is down. Unregister wext interface, by initializing wireless_handlers to NULL during interface down. Change-Id: I839d733595672c8c43e5a085ea5f1e97d98c4c31 CRs-Fixed: 1064023 --- core/hdd/src/wlan_hdd_main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 8b85b66e8820..56452b1cc757 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2742,10 +2742,21 @@ void hdd_cleanup_actionframe(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) * Return: None. */ void hdd_station_adapter_deinit(hdd_context_t *hdd_ctx, - hdd_adapter_t *adapter) + hdd_adapter_t *adapter, + bool rtnl_held) { ENTER_DEV(adapter->dev); + if (adapter->dev) { + if (rtnl_held) + adapter->dev->wireless_handlers = NULL; + else { + rtnl_lock(); + adapter->dev->wireless_handlers = NULL; + rtnl_unlock(); + } + } + if (test_bit(INIT_TX_RX_SUCCESS, &adapter->event_flags)) { hdd_deinit_tx_rx(adapter); clear_bit(INIT_TX_RX_SUCCESS, &adapter->event_flags); @@ -2798,7 +2809,7 @@ void hdd_deinit_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, case QDF_P2P_CLIENT_MODE: case QDF_P2P_DEVICE_MODE: { - hdd_station_adapter_deinit(hdd_ctx, adapter); + hdd_station_adapter_deinit(hdd_ctx, adapter, rtnl_held); break; }