qcacld-3.0: Add delete safe API for hdd_for_each_adapter_dev_held

hdd_for_each_adapter_dev_held will become infinite loop if the
adapter list entry is deleted in a parallel thread. This is because
deleting adapter list entry will make the entry to point to self. So,
it will loop for same adapter in the next iterations also.

To avoid this, get the current and next adapters at the start of
each iteration and take the corresponding netdev references.

Change-Id: I4bb65ce06c42c20bd9865f6a1ce7267ca69243e9
CRs-Fixed: 2799927
1 file changed