From 1fdadc8418bebba39899f341c3acdb189668e7f3 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 3 Feb 2025 11:26:36 +0100 Subject: [PATCH 1/2] ARM: s3c: Do not include These ARM architecture's source files do not require . Remove the include statements. Signed-off-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20250203102818.56747-3-tzimmermann@suse.de Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c/devs.c | 1 - arch/arm/mach-s3c/setup-fb-24bpp-s3c64xx.c | 1 - 2 files changed, 2 deletions(-) diff --git a/arch/arm/mach-s3c/devs.c b/arch/arm/mach-s3c/devs.c index 8c26d592d2a3..bab2abd8a34a 100644 --- a/arch/arm/mach-s3c/devs.c +++ b/arch/arm/mach-s3c/devs.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/arm/mach-s3c/setup-fb-24bpp-s3c64xx.c b/arch/arm/mach-s3c/setup-fb-24bpp-s3c64xx.c index cfa34b55ca21..c3269cd6a848 100644 --- a/arch/arm/mach-s3c/setup-fb-24bpp-s3c64xx.c +++ b/arch/arm/mach-s3c/setup-fb-24bpp-s3c64xx.c @@ -9,7 +9,6 @@ #include #include -#include #include #include "fb.h" From c8222ef6cf29dd7cad21643228f96535cc02b327 Mon Sep 17 00:00:00 2001 From: Chenyuan Yang Date: Wed, 12 Feb 2025 15:35:18 -0600 Subject: [PATCH 2/2] soc: samsung: exynos-chipid: Add NULL pointer check in exynos_chipid_probe() soc_dev_attr->revision could be NULL, thus, a pointer check is added to prevent potential NULL pointer dereference. This is similar to the fix in commit 3027e7b15b02 ("ice: Fix some null pointer dereference issues in ice_ptp.c"). This issue is found by our static analysis tool. Signed-off-by: Chenyuan Yang Link: https://lore.kernel.org/r/20250212213518.69432-1-chenyuan0y@gmail.com Fixes: 3253b7b7cd44 ("soc: samsung: Add exynos chipid driver support") Cc: Signed-off-by: Krzysztof Kozlowski --- drivers/soc/samsung/exynos-chipid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c index e37dde1fb588..95294462ff21 100644 --- a/drivers/soc/samsung/exynos-chipid.c +++ b/drivers/soc/samsung/exynos-chipid.c @@ -134,6 +134,8 @@ static int exynos_chipid_probe(struct platform_device *pdev) soc_dev_attr->revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%x", soc_info.revision); + if (!soc_dev_attr->revision) + return -ENOMEM; soc_dev_attr->soc_id = product_id_to_soc_id(soc_info.product_id); if (!soc_dev_attr->soc_id) { pr_err("Unknown SoC\n");