From: Greg Kroah-Hartman Date: Thu, 9 Oct 2025 13:34:08 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v6.6.111~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2050cdc5290ac8c72ed790679f7f029d23aaa1d1;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: platform-x86-int3472-check-for-adev-null.patch --- diff --git a/queue-5.15/platform-x86-int3472-check-for-adev-null.patch b/queue-5.15/platform-x86-int3472-check-for-adev-null.patch new file mode 100644 index 0000000000..0d43665b30 --- /dev/null +++ b/queue-5.15/platform-x86-int3472-check-for-adev-null.patch @@ -0,0 +1,55 @@ +From cd2fd6eab480dfc247b737cf7a3d6b009c4d0f1c Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 9 Dec 2024 23:05:19 +0100 +Subject: platform/x86: int3472: Check for adev == NULL +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Hans de Goede + +commit cd2fd6eab480dfc247b737cf7a3d6b009c4d0f1c upstream. + +Not all devices have an ACPI companion fwnode, so adev might be NULL. This +can e.g. (theoretically) happen when a user manually binds one of +the int3472 drivers to another i2c/platform device through sysfs. + +Add a check for adev not being set and return -ENODEV in that case to +avoid a possible NULL pointer deref in skl_int3472_get_acpi_buffer(). + +Signed-off-by: Hans de Goede +Link: https://lore.kernel.org/r/20241209220522.25288-1-hdegoede@redhat.com +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +[iwamatsu: adjusted context] +Signed-off-by: Nobuhiro Iwamatsu (CIP) +Signed-off-by: Greg Kroah-Hartman +--- + drivers/platform/x86/intel/int3472/discrete.c | 3 +++ + drivers/platform/x86/intel/int3472/tps68470.c | 3 +++ + 2 files changed, 6 insertions(+) + +--- a/drivers/platform/x86/intel/int3472/discrete.c ++++ b/drivers/platform/x86/intel/int3472/discrete.c +@@ -345,6 +345,9 @@ static int skl_int3472_discrete_probe(st + struct int3472_cldb cldb; + int ret; + ++ if (!adev) ++ return -ENODEV; ++ + ret = skl_int3472_fill_cldb(adev, &cldb); + if (ret) { + dev_err(&pdev->dev, "Couldn't fill CLDB structure\n"); +--- a/drivers/platform/x86/intel/int3472/tps68470.c ++++ b/drivers/platform/x86/intel/int3472/tps68470.c +@@ -102,6 +102,9 @@ static int skl_int3472_tps68470_probe(st + int device_type; + int ret; + ++ if (!adev) ++ return -ENODEV; ++ + regmap = devm_regmap_init_i2c(client, &tps68470_regmap_config); + if (IS_ERR(regmap)) { + dev_err(&client->dev, "Failed to create regmap: %ld\n", PTR_ERR(regmap)); diff --git a/queue-5.15/series b/queue-5.15/series index db12b4a00b..fafc324249 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -17,3 +17,4 @@ serial-stm32-allow-selecting-console-when-the-driver-is-module.patch staging-axis-fifo-fix-maximum-tx-packet-length-check.patch staging-axis-fifo-flush-rx-fifo-on-read-errors.patch driver-core-pm-set-power.no_callbacks-along-with-power.no_pm.patch +platform-x86-int3472-check-for-adev-null.patch