]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Aug 2024 13:53:55 +0000 (15:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Aug 2024 13:53:55 +0000 (15:53 +0200)
added patches:
hwmon-ltc2992-fix-memory-leak-in-ltc2992_parse_dt.patch
revert-drm-amd-display-validate-hw_points_num-before-using-it.patch

queue-5.15/hwmon-ltc2992-fix-memory-leak-in-ltc2992_parse_dt.patch [new file with mode: 0644]
queue-5.15/revert-drm-amd-display-validate-hw_points_num-before-using-it.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/hwmon-ltc2992-fix-memory-leak-in-ltc2992_parse_dt.patch b/queue-5.15/hwmon-ltc2992-fix-memory-leak-in-ltc2992_parse_dt.patch
new file mode 100644 (file)
index 0000000..0bdfe33
--- /dev/null
@@ -0,0 +1,41 @@
+From a94ff8e50c20bde6d50864849a98b106e45d30c6 Mon Sep 17 00:00:00 2001
+From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
+Date: Thu, 23 May 2024 17:47:14 +0200
+Subject: hwmon: (ltc2992) Fix memory leak in ltc2992_parse_dt()
+
+From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
+
+commit a94ff8e50c20bde6d50864849a98b106e45d30c6 upstream.
+
+A new error path was added to the fwnode_for_each_available_node() loop
+in ltc2992_parse_dt(), which leads to an early return that requires a
+call to fwnode_handle_put() to avoid a memory leak in that case.
+
+Add the missing fwnode_handle_put() in the error path from a zero value
+shunt resistor.
+
+Cc: stable@vger.kernel.org
+Fixes: 10b029020487 ("hwmon: (ltc2992) Avoid division by zero")
+Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
+Link: https://lore.kernel.org/r/20240523-fwnode_for_each_available_child_node_scoped-v2-1-701f3a03f2fb@gmail.com
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hwmon/ltc2992.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/hwmon/ltc2992.c
++++ b/drivers/hwmon/ltc2992.c
+@@ -913,9 +913,11 @@ static int ltc2992_parse_dt(struct ltc29
+               ret = fwnode_property_read_u32(child, "shunt-resistor-micro-ohms", &val);
+               if (!ret) {
+-                      if (!val)
++                      if (!val) {
++                              fwnode_handle_put(child);
+                               return dev_err_probe(&st->client->dev, -EINVAL,
+                                                    "shunt resistor value cannot be zero\n");
++                      }
+                       st->r_sense_uohm[addr] = val;
+               }
+       }
diff --git a/queue-5.15/revert-drm-amd-display-validate-hw_points_num-before-using-it.patch b/queue-5.15/revert-drm-amd-display-validate-hw_points_num-before-using-it.patch
new file mode 100644 (file)
index 0000000..0403993
--- /dev/null
@@ -0,0 +1,34 @@
+From 8f4bdbc8e99db6ec9cb0520748e49a2f2d7d1727 Mon Sep 17 00:00:00 2001
+From: Alex Hung <alex.hung@amd.com>
+Date: Wed, 11 Oct 2023 13:18:38 -0600
+Subject: Revert "drm/amd/display: Validate hw_points_num before using it"
+
+From: Alex Hung <alex.hung@amd.com>
+
+commit 8f4bdbc8e99db6ec9cb0520748e49a2f2d7d1727 upstream.
+
+This reverts commit 58c3b3341cea4f75dc8c003b89f8a6dd8ec55e50.
+
+[WHY & HOW]
+The writeback series cause a regression in thunderbolt display.
+
+Signed-off-by: Alex Hung <alex.hung@amd.com>
+Reviewed-by: Harry Wentland <harry.wentland@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dwb_cm.c |    3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dwb_cm.c
++++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dwb_cm.c
+@@ -243,9 +243,6 @@ static bool dwb3_program_ogam_lut(
+               return false;
+       }
+-      if (params->hw_points_num == 0)
+-              return false;
+-
+       REG_SET(DWB_OGAM_CONTROL, 0, DWB_OGAM_MODE, 2);
+       current_mode = dwb3_get_ogam_current(dwbc30);
index a52f99c83a068a3ecaa86599e4897a598ae8712a..39a77aab93c8fdf14d49b5e7f52a950dfe063d64 100644 (file)
@@ -164,3 +164,5 @@ hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch
 cxgb4-add-forgotten-u64-ivlan-cast-before-shift.patch
 kvm-arm64-make-icc_-sgi-_el1-undef-in-the-absence-of-a-vgicv3.patch
 mmc-dw_mmc-allow-biu-and-ciu-clocks-to-defer.patch
+revert-drm-amd-display-validate-hw_points_num-before-using-it.patch
+hwmon-ltc2992-fix-memory-leak-in-ltc2992_parse_dt.patch