소스 검색

qcacmn: Check client count below HIF_RTPM_ID_MAX

While registering a client, HIF_RTPM_ID_MAX is also being
checked for registering.
Fix is to exclude HIF_RTPM_ID_MAX id.

Change-Id: I57e572abc22a27586cf350af423293a8b455af1c
CRs-Fixed: 3223394
Ananya Gupta 3 년 전
부모
커밋
025b889ef6
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      hif/src/hif_main.h
  2. 1 1
      hif/src/hif_runtime_pm.c

+ 1 - 1
hif/src/hif_main.h

@@ -568,7 +568,7 @@ void hif_cleanup_static_buf_to_target(struct hif_softc *scn);
 void hif_runtime_prevent_linkdown(struct hif_softc *scn, bool is_get);
 #else
 static inline
-void hif_runtime_prevent_linkdown(struct hif_softc * scn, bool is_get)
+void hif_runtime_prevent_linkdown(struct hif_softc *scn, bool is_get)
 {
 }
 #endif

+ 1 - 1
hif/src/hif_runtime_pm.c

@@ -418,7 +418,7 @@ QDF_STATUS hif_rtpm_register(uint32_t id, void (*hif_rtpm_cbk)(void))
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	if (id > HIF_RTPM_ID_MAX || gp_hif_rtpm_ctx->clients[id]) {
+	if (id >= HIF_RTPM_ID_MAX || gp_hif_rtpm_ctx->clients[id]) {
 		hif_err("Invalid client %d", id);
 		return QDF_STATUS_E_INVAL;
 	}