[DTV00857290][[DTV][Coverity Scanned Code Defect] 15367: Out-of-bounds write]

[Description]
Fix coverity defects under mgmt/

i. Fix "array compared against 0" issues.
ii. Remove do-while style flow.

[Related CIDs]
CID15444

Conflicts:
	mgmt/p2p_func.c

Change-Id: Ia7d75173cda7af97d3d40d0e75c1d76adf26b141
Signed-off-by: Awk Jiang <awk.jiang@mediatek.com>
CR-Id: DTV00857290
Feature: misc
(cherry picked from commit 76ea276a77c5018834151336203a758e3faf6ddb)
1 file changed