From bce7698e2e6565bb765bd0522337f29f5f312624 Mon Sep 17 00:00:00 2001 From: Haojie Li Date: Tue, 25 Aug 2026 18:08:45 +0800 Subject: drm/mediatek: Add missing IS_ERR check for ovl_adaptor platform device platform_device_register_data() can fail and return an ERR_PTR, but the return value is used without checking, leading to an invalid pointer being stored in ddp_comp[].dev and passed to component_match_add() and mtk_ddp_comp_init(), which could result in a kernel crash. Add an IS_ERR() check to jump to the error handling path on failure. Fixes: 0d9eee9118b7 ("drm/mediatek: Add drm ovl_adaptor sub driver for MT8195") Cc: stable@vger.kernel.org Signed-off-by: Haojie Li Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20260825100845.438893-1-lihaojie@kylinos.cn/ Signed-off-by: Chun-Kuang Hu --- tools/testing/kunit/configs/all_tests.config | 63 +++++++++++++++++++++++++ tools/testing/kunit/configs/arch_uml.config | 7 +++ tools/testing/kunit/configs/coverage_uml.config | 11 +++++ tools/testing/kunit/configs/default.config | 4 ++ 4 files changed, 85 insertions(+) create mode 100644 tools/testing/kunit/configs/all_tests.config create mode 100644 tools/testing/kunit/configs/arch_uml.config create mode 100644 tools/testing/kunit/configs/coverage_uml.config create mode 100644 tools/testing/kunit/configs/default.config (limited to 'tools/testing/kunit/configs') diff --git a/tools/testing/kunit/configs/all_tests.config b/tools/testing/kunit/configs/all_tests.config new file mode 100644 index 000000000..31e930a0f --- /dev/null +++ b/tools/testing/kunit/configs/all_tests.config @@ -0,0 +1,63 @@ +# This config enables as many tests as possible under UML. +# It is intended for use in continuous integration systems and similar for +# automated testing of as much as possible. +# The config is manually maintained, though it uses KUNIT_ALL_TESTS=y to enable +# any tests whose dependencies are already satisfied. Please feel free to add +# more options if they any new tests. + +CONFIG_KUNIT=y +CONFIG_KUNIT_EXAMPLE_TEST=y +CONFIG_KUNIT_ALL_TESTS=y + +CONFIG_FORTIFY_SOURCE=y + +CONFIG_IIO=y + +CONFIG_EXT4_FS=y + +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y + +CONFIG_PCI=y +CONFIG_USB4=y +CONFIG_I2C=y +CONFIG_SPI=y +CONFIG_GPIOLIB=y + +CONFIG_NET=y +CONFIG_MCTP=y +CONFIG_MCTP_FLOWS=y + +CONFIG_INET=y +CONFIG_MPTCP=y + +CONFIG_NETDEVICES=y +CONFIG_WLAN=y +CONFIG_CFG80211=y +CONFIG_MAC80211=y +CONFIG_WLAN_VENDOR_INTEL=y +CONFIG_IWLWIFI=y + +CONFIG_DAMON=y +CONFIG_DAMON_VADDR=y +CONFIG_DAMON_PADDR=y + +CONFIG_REGMAP_BUILD=y + +CONFIG_AUDIT=y + +CONFIG_CRYPTO_LIB_ENABLE_ALL_FOR_KUNIT=y + +CONFIG_PRIME_NUMBERS=y + +CONFIG_CRC_ENABLE_ALL_FOR_KUNIT=y + +CONFIG_SECURITY=y +CONFIG_SECURITY_APPARMOR=y +CONFIG_SECURITY_LANDLOCK=y + +CONFIG_SOUND=y +CONFIG_SND=y +CONFIG_SND_SOC=y +CONFIG_SND_SOC_TOPOLOGY_BUILD=y +CONFIG_SND_SOC_CS35L56_I2C=y diff --git a/tools/testing/kunit/configs/arch_uml.config b/tools/testing/kunit/configs/arch_uml.config new file mode 100644 index 000000000..28edf816a --- /dev/null +++ b/tools/testing/kunit/configs/arch_uml.config @@ -0,0 +1,7 @@ +# Config options which are added to UML builds by default + +# Enable pci, as a lot of tests require it. +CONFIG_KUNIT_UML_PCI=y + +# Enable FORTIFY_SOURCE for wider checking. +CONFIG_FORTIFY_SOURCE=y diff --git a/tools/testing/kunit/configs/coverage_uml.config b/tools/testing/kunit/configs/coverage_uml.config new file mode 100644 index 000000000..bacb77664 --- /dev/null +++ b/tools/testing/kunit/configs/coverage_uml.config @@ -0,0 +1,11 @@ +# This config fragment enables coverage on UML, which is different from the +# normal gcov used in other arches (no debugfs). +# Example usage: +# ./tools/testing/kunit/kunit.py run \ +# --kunitconfig=tools/testing/kunit/configs/all_tests_uml.config \ +# --kunitconfig=tools/testing/kunit/configs/coverage_uml.config + +CONFIG_DEBUG_KERNEL=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y +CONFIG_GCOV=y diff --git a/tools/testing/kunit/configs/default.config b/tools/testing/kunit/configs/default.config new file mode 100644 index 000000000..2f24147c9 --- /dev/null +++ b/tools/testing/kunit/configs/default.config @@ -0,0 +1,4 @@ +CONFIG_KUNIT=y +CONFIG_KUNIT_EXAMPLE_TEST=y +CONFIG_KUNIT_ALL_TESTS=y +CONFIG_SPI=y -- cgit v1.3.1