]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 11:32:36 +0000 (12:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 11:32:36 +0000 (12:32 +0100)
added patches:
efi-cper-fix-cper_bits_to_str-buffer-handling-and-return-value.patch

queue-6.1/efi-cper-fix-cper_bits_to_str-buffer-handling-and-return-value.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/efi-cper-fix-cper_bits_to_str-buffer-handling-and-return-value.patch b/queue-6.1/efi-cper-fix-cper_bits_to_str-buffer-handling-and-return-value.patch
new file mode 100644 (file)
index 0000000..be179e5
--- /dev/null
@@ -0,0 +1,35 @@
+From d7f1b4bdc7108be1b178e1617b5f45c8918e88d7 Mon Sep 17 00:00:00 2001
+From: Morduan Zang <zhangdandan@uniontech.com>
+Date: Wed, 14 Jan 2026 13:30:33 +0800
+Subject: efi/cper: Fix cper_bits_to_str buffer handling and return value
+
+From: Morduan Zang <zhangdandan@uniontech.com>
+
+commit d7f1b4bdc7108be1b178e1617b5f45c8918e88d7 upstream.
+
+The return value calculation was incorrect: `return len - buf_size;`
+Initially `len = buf_size`, then `len` decreases with each operation.
+This results in a negative return value on success.
+
+Fix by returning `buf_size - len` which correctly calculates the actual
+number of bytes written.
+
+Fixes: a976d790f494 ("efi/cper: Add a new helper function to print bitmasks")
+Signed-off-by: Morduan Zang <zhangdandan@uniontech.com>
+Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/firmware/efi/cper.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/firmware/efi/cper.c
++++ b/drivers/firmware/efi/cper.c
+@@ -161,7 +161,7 @@ int cper_bits_to_str(char *buf, int buf_
+               len -= size;
+               str += size;
+       }
+-      return len - buf_size;
++      return buf_size - len;
+ }
+ EXPORT_SYMBOL_GPL(cper_bits_to_str);
index db6096457cba601a3cc83fca8087e12fe2a2012f..25be01389ae96f30af28b139c8f1257387e0cd8d 100644 (file)
@@ -1 +1,2 @@
 firmware-imx-scu-irq-set-mu_resource_id-before-get-handle.patch
+efi-cper-fix-cper_bits_to_str-buffer-handling-and-return-value.patch