Skip to content

Commit aedc364

Browse files
Dan Carpentergregkh
authored andcommitted
hte: tegra-194: Fix off by one in tegra_hte_map_to_line_id()
[ Upstream commit e078180 ] 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: 09574cc ("hte: Add Tegra194 HTE kernel provider") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Dipen Patel <dipenp@nvidia.com> Signed-off-by: Dipen Patel <dipenp@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2cb3152 commit aedc364

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/hte/hte-tegra194.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static int tegra_hte_map_to_line_id(u32 eid,
251251
{
252252

253253
if (m) {
254-
if (eid > map_sz)
254+
if (eid >= map_sz)
255255
return -EINVAL;
256256
if (m[eid].slice == NV_AON_SLICE_INVALID)
257257
return -EINVAL;

0 commit comments

Comments
 (0)