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

[Description]
Fix cid 361524 "Out-of-bounds read" in p2p_func.c

Change-Id: Ia11b57b5491d577f54b6f2091430d3a2575330d1
Signed-off-by: Danny Wu <danny.wu@mediatek.com>
CR-Id: DTV00857290
(cherry picked from commit 9c63bc7fac04a0cbbce95bdcb43162e6026a5055)
diff --git a/mgmt/p2p_func.c b/mgmt/p2p_func.c
index a1e013d..bb10e10 100644
--- a/mgmt/p2p_func.c
+++ b/mgmt/p2p_func.c
@@ -783,7 +783,7 @@
 	do {
 		ASSERT_BREAK((prAdapter != NULL) && (pucBssIdx != NULL));
 
-		if (ucRoleIdx > BSS_P2P_NUM) {
+		if (ucRoleIdx >= BSS_P2P_NUM) {
 			rWlanStatus = WLAN_STATUS_FAILURE;
 			break;
 		}