Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21e9000c authored by Maulik Shah's avatar Maulik Shah
Browse files

drivers: soc: qcom: rpmh-rsc: Correct check for slot number



Return index value from bitmap_find_next_zero_area can be higher
than available slot. Correct check for same.

Change-Id: I544937c31e03b582a08f73c1d7013060aaa2e654
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
parent b19f7290
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -492,7 +492,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);