]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Mar 2026 07:23:59 +0000 (08:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Mar 2026 07:23:59 +0000 (08:23 +0100)
added patches:
hwmon-pmbus-isl68137-fix-unchecked-return-value-and-use-sysfs_emit.patch

queue-5.10/hwmon-pmbus-isl68137-fix-unchecked-return-value-and-use-sysfs_emit.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/hwmon-pmbus-isl68137-fix-unchecked-return-value-and-use-sysfs_emit.patch b/queue-5.10/hwmon-pmbus-isl68137-fix-unchecked-return-value-and-use-sysfs_emit.patch
new file mode 100644 (file)
index 0000000..3029eca
--- /dev/null
@@ -0,0 +1,44 @@
+From 86259558e422b250aa6aa57163a6d759074573f5 Mon Sep 17 00:00:00 2001
+From: Sanman Pradhan <psanman@juniper.net>
+Date: Wed, 18 Mar 2026 19:40:19 +0000
+Subject: hwmon: (pmbus/isl68137) Fix unchecked return value and use sysfs_emit()
+
+From: Sanman Pradhan <psanman@juniper.net>
+
+commit 86259558e422b250aa6aa57163a6d759074573f5 upstream.
+
+isl68137_avs_enable_show_page() uses the return value of
+pmbus_read_byte_data() without checking for errors. If the I2C transaction
+fails, a negative error code is passed through bitwise operations,
+producing incorrect output.
+
+Add an error check to propagate the return value if it is negative.
+Additionally, modernize the callback by replacing sprintf()
+with sysfs_emit().
+
+Fixes: 038a9c3d1e424 ("hwmon: (pmbus/isl68137) Add driver for Intersil ISL68137 PWM Controller")
+Cc: stable@vger.kernel.org
+Signed-off-by: Sanman Pradhan <psanman@juniper.net>
+Link: https://lore.kernel.org/r/20260318193952.47908-2-sanman.pradhan@hpe.com
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hwmon/pmbus/isl68137.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/drivers/hwmon/pmbus/isl68137.c
++++ b/drivers/hwmon/pmbus/isl68137.c
+@@ -80,8 +80,11 @@ static ssize_t isl68137_avs_enable_show_
+ {
+       int val = pmbus_read_byte_data(client, page, PMBUS_OPERATION);
+-      return sprintf(buf, "%d\n",
+-                     (val & ISL68137_VOUT_AVS) == ISL68137_VOUT_AVS ? 1 : 0);
++      if (val < 0)
++              return val;
++
++      return sysfs_emit(buf, "%d\n",
++                         (val & ISL68137_VOUT_AVS) == ISL68137_VOUT_AVS);
+ }
+ static ssize_t isl68137_avs_enable_store_page(struct i2c_client *client,
index d6dad3d1845f2292350f6ee96554d935a85cc789..a1e90267b49fdeb890437700700dbb4fb7fc205b 100644 (file)
@@ -227,3 +227,4 @@ net-bonding-fix-null-deref-in-bond_debug_rlb_hash_sh.patch
 nfnetlink_osf-validate-individual-option-lengths-in-.patch
 net-dsa-bcm_sf2-fix-missing-clk_disable_unprepare-in.patch
 icmp-fix-null-pointer-dereference-in-icmp_tag_valida.patch
+hwmon-pmbus-isl68137-fix-unchecked-return-value-and-use-sysfs_emit.patch