qcacmn: Fix bounds check in populate_mac_phy_capability

In populate_mac_phy_capability, bounds on an array are checked after
writing to the array. This leads to writing to one past the end of the
array under error conditions. Check the bounds of the array before,
rather than after, writing to it in populate_mac_phy_capability.

Change-Id: I34c7415b8fb925bea5a715214e3aa3ac8a4bacc8
CRs-Fixed: 2059155
1 file changed