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

Commit d81a3c5b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: mailbox: rpmh: fix validation check in probe"

parents 91a756a8 ac6e850d
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -1178,11 +1178,10 @@ static int rsc_drv_probe(struct platform_device *pdev)
		if (tcs->num_tcs <= 0 || tcs->type == CONTROL_TCS)
			continue;

		if (tcs->num_tcs > MAX_TCS_PER_TYPE)
			return -EINVAL;

		if (st + tcs->num_tcs > max_tcs &&
				st + tcs->num_tcs >= sizeof(tcs->tcs_mask))
		if (tcs->num_tcs > MAX_TCS_PER_TYPE ||
			st + tcs->num_tcs > max_tcs ||
			st + tcs->num_tcs >=
				BITS_PER_BYTE * sizeof(tcs->tcs_mask))
			return -EINVAL;

		tcs->tcs_mask = ((1 << tcs->num_tcs) - 1) << st;