From 17b5c4f349c90a99502811d9b7ddbd009855be7d Mon Sep 17 00:00:00 2001 From: Bapiraju Alla Date: Tue, 27 Oct 2020 15:03:34 +0530 Subject: [PATCH] qcacld-3.0: Don't start monitor mode if monitor interface is already up Currently, interface status is not being checked to start monitor mode. This is allowing to start monitor mode more than once for the same interface. This will result in session leak during de-init. To avoid this, start monitor mode only if the interface is not already up. Change-Id: I118167d3a8cea52fbfa825b226b837087828f148 CRs-fixed: 2803090 --- core/hdd/src/wlan_hdd_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index bce00bade4..3cacb32f21 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2737,6 +2737,11 @@ static int __hdd_mon_open(struct net_device *dev) hdd_enter_dev(dev); + if (test_bit(DEVICE_IFACE_OPENED, &adapter->event_flags)) { + hdd_debug_rl("Monitor interface is already up"); + return 0; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret) return ret;