Commit e078180d authored by Dan Carpenter's avatar Dan Carpenter Committed by Dipen Patel
Browse files

hte: tegra-194: Fix off by one in tegra_hte_map_to_line_id()



The "map_sz" is the number of elements in the "m" array so the >
comparison needs to be changed to >= to prevent an out of bounds
read.

Fixes: 09574cca ("hte: Add Tegra194 HTE kernel provider")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Acked-by: default avatarDipen Patel <dipenp@nvidia.com>
Signed-off-by: default avatarDipen Patel <dipenp@nvidia.com>
parent 6680c835
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -367,7 +367,7 @@ static int tegra_hte_map_to_line_id(u32 eid,
{

	if (m) {
		if (eid > map_sz)
		if (eid >= map_sz)
			return -EINVAL;
		if (m[eid].slice == NV_AON_SLICE_INVALID)
			return -EINVAL;