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
Tento commit je obsažen v:
Ananya Gupta
2022-06-17 15:04:04 +05:30
odevzdal Madan Koyyalamudi
rodič 5e7510f34a
revize 025b889ef6
2 změnil soubory, kde provedl 2 přidání a 2 odebrání

Zobrazit soubor

@@ -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

Zobrazit soubor

@@ -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;
}