wlan: Prevent potential race condition during adapter access

Currently in the driver, there is a possiblity of a race condition
between hdd_wlan_suspend and del_virtual_interface. In hdd_wlan_suspend,
the driver iterates over all the adapters and performs designated action
for each. During the process of iteration, there is no lock to prevent
race conditions. In the scenario when a del_virtual_interface comes
while this iteration is in progress, it can happen that the adapter is
cleared in the del_virtual interface path and the same is tried to be
accessed in the hdd_wlan_suspend.

To avoid this possible scenario, lock the iteration with dev_hold which
prevents the unregistration of the netdev. Also call hdd_deinit_adapter
in the del_interface path which clears the timer that is responsible for
calling the suspend call.

Change-Id: Iebf68287c38c8babb0d91b4a11d4d01d53ae8ddc
CRs-Fixed: 2512741
2 files changed
tree: 828840466f809ea4e72d93e14528801ec4c20859
  1. CORE/
  2. firmware_bin/
  3. riva/
  4. Android.mk
  5. Kbuild
  6. Kconfig
  7. Makefile