summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorMaulik Shah <mkshah@codeaurora.org>2019-02-21 18:10:36 +0530
committerAndy Gross <agross@kernel.org>2019-04-09 23:40:09 -0500
commitbbeac60f064158aa92b4c72fb50b12231e62cbcd (patch)
tree5ed37ed7cfa67719f2bc3be1358df965455c1391 /drivers/soc
parent93b260528020792032e50725383f27a27897bb0f (diff)
downloadlinux-bbeac60f064158aa92b4c72fb50b12231e62cbcd.tar.bz2
drivers: soc: qcom: rpmh-rsc: Correct check for slot number
The return index value from bitmap_find_next_zero_area can be higher than available slot. So correct the check to return error in such case. Signed-off-by: Maulik Shah <mkshah@codeaurora.org> Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org> Reviewed-by: Lina Iyer <ilina@codeaurora.org> Signed-off-by: Andy Gross <agross@kernel.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/qcom/rpmh-rsc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
index 75bd9a83aef0..e278fc11fe5c 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -459,7 +459,7 @@ static int find_slots(struct tcs_group *tcs, const struct tcs_request *msg,
do {
slot = bitmap_find_next_zero_area(tcs->slots, MAX_TCS_SLOTS,
i, msg->num_cmds, 0);
- if (slot == tcs->num_tcs * tcs->ncpt)
+ if (slot >= tcs->num_tcs * tcs->ncpt)
return -ENOMEM;
i += tcs->ncpt;
} while (slot + msg->num_cmds - 1 >= i);