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

Commit 26abecf3 authored by Maya Erez's avatar Maya Erez
Browse files

usb: host: Fix smask_out array access to a non verified index



Fix code quality issues found by the automatic checking tool.
Verify hs_transfers before accessing the smask_out array
in this index.

Change-Id: I724278f4972c471431993270d3962230b1c69791
CRs-Fixed: 566927
Signed-off-by: default avatarDanny Segal <dsegal@codeaurora.org>
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
parent c5b954d0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1027,8 +1027,11 @@ iso_stream_init (
			/* c-mask as specified in USB 2.0 11.18.4 3.c */
			tmp = (1 << (hs_transfers + 2)) - 1;
			stream->raw_mask |= tmp << (8 + 2);
		} else
		} else if (hs_transfers <=
				(sizeof(smask_out) / sizeof(smask_out[0]))) {
			stream->raw_mask = smask_out [hs_transfers - 1];
		}

		bandwidth = stream->usecs + stream->c_usecs;
		bandwidth /= interval << 3;