From: Colin Ian King <colin.i.king@gmail.com>
To: "Rafael J . Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>, James Morse <james.morse@arm.com>,
Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
Zaid Alali <zaidal@os.amperecomputing.com>,
Ira Weiny <ira.weiny@intel.com>,
linux-acpi@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] ACPI: APEI: EINJ: Fix less than zero comparison on a size_t variable
Date: Tue, 24 Jun 2025 21:10:32 +0100 [thread overview]
Message-ID: <20250624201032.522168-1-colin.i.king@gmail.com> (raw)
The check for c < 0 is always false because variable c is a size_t which
is not a signed type. Fix this by making c a ssize_t.
Fixes: 90711f7bdf76 ("ACPI: APEI: EINJ: Create debugfs files to enter device id and syndrome")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/acpi/apei/einj-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c
index d6d7e36e3647..7930acd1d3f3 100644
--- a/drivers/acpi/apei/einj-core.c
+++ b/drivers/acpi/apei/einj-core.c
@@ -909,7 +909,7 @@ static ssize_t u128_write(struct file *f, const char __user *buf, size_t count,
u8 tmp[COMPONENT_LEN];
char byte[3] = {};
char *s, *e;
- size_t c;
+ ssize_t c;
long val;
int i;
--
2.50.0
next reply other threads:[~2025-06-24 20:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 20:10 Colin Ian King [this message]
2025-06-24 21:10 ` [PATCH][next] ACPI: APEI: EINJ: Fix less than zero comparison on a size_t variable Ira Weiny
2025-06-26 18:51 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250624201032.522168-1-colin.i.king@gmail.com \
--to=colin.i.king@gmail.com \
--cc=bp@alien8.de \
--cc=ira.weiny@intel.com \
--cc=james.morse@arm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=tony.luck@intel.com \
--cc=zaidal@os.amperecomputing.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox