clocksource/drivers/exynos_mct: Handle DTS with higher number of interrupts
stable inclusion from stable-v5.10.110 commit db9d00461bdf9a0567a899f2980cf47f4217476d bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=db9d00461bdf9a0567a899f2980cf47f4217476d -------------------------------- [ Upstream commit ab8da93d ] The driver statically defines maximum number of interrupts it can handle, however it does not respect that limit when configuring them. When provided with a DTS with more interrupts than assumed, the driver will overwrite static array mct_irqs leading to silent memory corruption. Validate the interrupts coming from DTS to avoid this. This does not change the fact that such DTS might not boot at all, because it is simply incompatible, however at least some warning will be printed. Fixes: 36ba5d52 ("ARM: EXYNOS: add device tree support for MCT controller driver") Signed-off-by: NKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Link: https://lore.kernel.org/r/20220220103815.135380-1-krzysztof.kozlowski@canonical.comSigned-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NYu Liao <liaoyu15@huawei.com> Reviewed-by: NWei Li <liwei391@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录