qcacld-3.0: Fix kernel panic during driver load failure

In low memory conditions TX/RX histogram memory allocation failure
is not handled properly and because of it 2 kernel panics are observed.
1st kernel panic is caused when freed HDD context is de-referenced in
hdd_wlan_startup and 2nd kernel panic is caused by kernel wake lock
list corruption because WLAN driver during load failure corrupted kernel's
wake lock list.

As part of this fix make sure TX/RX histogram memory allocation failure
is handled gracefully by properly sending failure reason code to
hdd_wlan_startup.

Also in order to make fix complete and avoid any other kernel panic, deinit
HDD context properly by freeing all HDD created wake locks such that when
HDD context is freed its wake locks are not poisoned to 0x6b6b6b6b6b6b6b6b
(SLUB magic pattern) pattern by kernel and hence corrupting kernel wake lock
list.

This fix ensures driver load failure caused by TX/RX histogram allocation
failure is handled gracefully in low memory conditions without leading to
any kernel panic.

Change-Id: I17a46c346402642f39e6548cd40bedd1f7ff96a4
CRs-Fixed: 1069014
2 files changed
tree: bf523d169cc2ccad0cbadc4afa451a6a8f15efd3
  1. core/
  2. target/
  3. uapi/
  4. Android.mk
  5. Kbuild
  6. Kconfig
  7. Makefile
  8. README.txt