diff options
| author | Saad Anjum <saadanjum239@gmail.com> | 2026-10-05 11:06:41 +0500 |
|---|---|---|
| committer | Linus Walleij <linusw@kernel.org> | 2026-11-04 13:26:25 +0100 |
| commit | 784118478160751016b3bc437d009890fa20f3f7 (patch) | |
| tree | dfff7a3f8a3f12658ecd4f5d8756e17626918821 /scripts/Makefile.thinlto | |
| parent | 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 (diff) | |
| download | linux-next-784118478160751016b3bc437d009890fa20f3f7.tar.gz linux-next-784118478160751016b3bc437d009890fa20f3f7.zip | |
pinctrl: mediatek: common-v2: Fix of_iomap() error check
of_iomap() returns NULL on failure, never an error pointer, so the
IS_ERR() check in mtk_build_eint() can never be true. The check was
carried over from the previous devm_platform_ioremap_resource_byname()
call, which does return an error pointer, when the EINT registers were
switched to being mapped with of_iomap() to support multiple bases.
If mapping one of the EINT register ranges fails, for example because
the device tree node lists more "reg-names" than "reg" entries so that
of_address_to_resource() fails, or because ioremap() itself fails, the
NULL pointer is stored in hw->eint->base[] and probing continues.
mtk_eint_do_init() then calls mtk_eint_hw_init(), which writes to
eint->base[i] + regs->dom_en, causing a NULL pointer dereference
instead of a clean probe failure.
Check for NULL and return -ENOMEM instead. The existing error path
already skips NULL entries when unmapping, so any ranges mapped before
the failure are still released.
Fixes: 3ef9f710efcb ("pinctrl: mediatek: Add EINT support for multiple addresses")
Signed-off-by: Saad Anjum <saadanjum239@gmail.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
