提交 bbeac60f 编写于 作者: M Maulik Shah 提交者: 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: NMaulik Shah <mkshah@codeaurora.org>
Signed-off-by: NRaju P.L.S.S.S.N <rplsssn@codeaurora.org>
Reviewed-by: NLina Iyer <ilina@codeaurora.org>
Signed-off-by: NAndy Gross <agross@kernel.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册