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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:31:50 +0000 (13:31 +0100)
commitb75d11a62bb359777bcf6182aa234fe0c9d5bf39
tree6b59f875b34402c7b7e7825de721f28ce56a2fc7
parentd8ed37219e27fe1b9c8459ab1756884fa4a74404
soc/tegra: cbb: Add checks for potential out of bound errors

[ Upstream commit 55084947d6b48977c5122fbe443743a6c50c12bf ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soc/tegra/cbb/tegra234-cbb.c