soc/tegra: cbb: Add checks for potential out of bound errors
authorSumit Gupta <sumitg@nvidia.com>
Wed, 9 Nov 2022 13:57:16 +0000 (19:27 +0530)
committerThierry Reding <treding@nvidia.com>
Fri, 11 Nov 2022 14:39:23 +0000 (15:39 +0100)
commit55084947d6b48977c5122fbe443743a6c50c12bf
tree254bc410d7b0e9b7ded7d2d19d7c7020948d98ec
parentcd1d719b47767f1970d02d18661122b649c35b00
soc/tegra: cbb: Add checks for potential out of bound errors

Added checks to avoid potential out of bounds errors which can happen if
the 'slave map' and 'CBB errors' arrays are not correct or latest where
some entries are missing.

Fixes: fc2f151d2314 ("soc/tegra: cbb: Add driver for Tegra234 CBB 2.0")
Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/soc/tegra/cbb/tegra234-cbb.c