Commit bbeac60f authored by Maulik Shah's avatar Maulik Shah Committed by Andy Gross

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: default avatarMaulik Shah <mkshah@codeaurora.org>
Signed-off-by: default avatarRaju P.L.S.S.S.N <rplsssn@codeaurora.org>
Reviewed-by: default avatarLina Iyer <ilina@codeaurora.org>
Signed-off-by: default avatarAndy Gross <agross@kernel.org>
parent 93b26052
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment