mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
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: 09574cca6a ("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>
This commit is contained in:
parent
6680c835ad
commit
e078180d66
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue