From: Greg Kroah-Hartman Date: Mon, 19 Jan 2026 11:32:47 +0000 (+0100) Subject: 6.6-stable patches X-Git-Tag: v5.15.198~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf7e48482c20d8d8093e3bf49530d074846f1177;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: efi-cper-fix-cper_bits_to_str-buffer-handling-and-return-value.patch --- diff --git a/queue-6.6/efi-cper-fix-cper_bits_to_str-buffer-handling-and-return-value.patch b/queue-6.6/efi-cper-fix-cper_bits_to_str-buffer-handling-and-return-value.patch new file mode 100644 index 0000000000..25cb03bbad --- /dev/null +++ b/queue-6.6/efi-cper-fix-cper_bits_to_str-buffer-handling-and-return-value.patch @@ -0,0 +1,35 @@ +From d7f1b4bdc7108be1b178e1617b5f45c8918e88d7 Mon Sep 17 00:00:00 2001 +From: Morduan Zang +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 + +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 +Signed-off-by: Ard Biesheuvel +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -162,7 +162,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); + diff --git a/queue-6.6/series b/queue-6.6/series index db6096457c..25be01389a 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -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