]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Oct 2025 13:34:08 +0000 (15:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Oct 2025 13:34:08 +0000 (15:34 +0200)
added patches:
platform-x86-int3472-check-for-adev-null.patch

queue-5.15/platform-x86-int3472-check-for-adev-null.patch [new file with mode: 0644]
queue-5.15/series

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 (file)
index 0000000..0d43665
--- /dev/null
@@ -0,0 +1,55 @@
+From cd2fd6eab480dfc247b737cf7a3d6b009c4d0f1c Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+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 <hdegoede@redhat.com>
+
+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 <hdegoede@redhat.com>
+Link: https://lore.kernel.org/r/20241209220522.25288-1-hdegoede@redhat.com
+Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+[iwamatsu: adjusted context]
+Signed-off-by: Nobuhiro Iwamatsu (CIP) <nobuhiro.iwamatsu.x90@mail.toshiba>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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));
index db12b4a00bad2d664e8cd1e91103c4479f46a409..fafc324249d71590758df0ead014001a760903ed 100644 (file)
@@ -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