qcacld-3.0: Fix channel avoid frequency list corruption

In wlan_hdd_merge_avoid_freqs() there is a test to determine if the
merged frequency list will exceed the size of the destination buffer,
and if so, the function returns an error. Unfortunately the method to
determine overflow actually modifies the information in the
destination list, and so if the error return occurs the destination
list will contain an incorrect, too large, destination list size.
Address this issue by determining if the list will overflow prior to
modifying the destination list size.

Change-Id: I9ede0bc24c676d6a9ef124d83c36ca9860b847f7
CRs-Fixed: 2410138
1 file changed