TDLS: Address tdls synchronization issues using tdls_lock

Since tdls_lock is aqcuired after tdls context validity checks
in registered tdls timer functions, its possible that tdls
context is freed in one thread by aqcuiring tdls lock meanwhile
the other thread waiting to aqcuire the tdls lock might endup in
accessing the freed context on acquiring tdls lock since it has
already passed the validity checks of the tdls contexts.

This commit ensures tdls lock is acquired before tdls context has
been validated in registered timer callbacks. It also ensures to
return failure if back to back tdls sta init is invoked and if tdls
sta init is called on adapter other than STA/P2P client.

Change-Id: I1da58fa2ee9efe99a4048feca90b3be13ae1ebdc
CRs-Fixed: 796281
2 files changed
tree: fcd3be4f0317e7e3d9ba2640b2c68046e1e7ab42
  1. CORE/
  2. firmware_bin/
  3. riva/
  4. Android.mk
  5. Kbuild
  6. Kconfig
  7. Makefile