drivers: qcom: rpmh-rsc: fix the loop index check in get_req_from_tcs
Subsystems (2)
PATCH 1/7 drivers: qcom: rpmh-rsc: fix the loop index check in get_req_from_tcs
From: "Raju P.L.S.S.S.N" <[email protected]>
get_req_from_tcs introduced in patch[1] returns tcs_request from tcs_group. The size of tcs (of type - tcs_group) array in rsc_drv is TCS_TYPE_NR. So the loop index needs to be iterated up to TCS_TYPE_NR only.
[1] https://patchwork.kernel.org/patch/10477547/
--- drivers/soc/qcom/rpmh-rsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/rpmh-rsc.c +1 -1
@@ -190,7 +190,7 @@ static const struct tcs_request *get_req_from_tcs(struct rsc_drv *drv,struct tcs_group *tcs;int i; -for (i =0 ; i < drv->num_tcs; i++) { +for (i =0 ; i <TCS_TYPE_NR ; i++) { tcs = &drv->tcs[i];if (tcs->mask &BIT (tcs_id))return tcs->req[tcs_id - tcs->offset];
Signature · 1 line
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project
Hi all,
This is an independent patch and not part of patch set. There was some issue while sending the patch using git send-email. Please ignore 1/7 in the mail subject. Sorry for multiple mails.
Thanks,
Raju.
Quoted 27 lines · Raju P L S S S N
From: "Raju P.L.S.S.S.N" <[email protected]>
get_req_from_tcsintroduced in patch[1] returnstcs_requestfromtcs_group. The size of tcs (of type -tcs_group) array inrsc_drvisTCS_TYPE_NR. So the loop index needs to be iterated up toTCS_TYPE_NRonly.[1] https://patchwork.kernel.org/patch/10477547/
Signed-off-by Raju P.L.S.S.S.N <[email protected]>--- drivers/soc/qcom/rpmh-rsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/soc/qcom/rpmh-rsc.c +1
-1@@ -190,7 +190,7 @@ static const struct tcs_request *get_req_from_tcs(struct rsc_drv *drv,struct tcs_group *tcs;int i; -for (i =0 ; i < drv->num_tcs; i++) { +for (i =0 ; i <TCS_TYPE_NR ; i++) { tcs = &drv->tcs[i];if (tcs->mask &BIT (tcs_id))return tcs->req[tcs_id - tcs->offset];