ACPI: APEI: EINJ: Fix less than zero comparison on a size_t variable
Subsystems (3)
PATCH 1/1 ACPI: APEI: EINJ: Fix less than zero comparison on a size_t variable
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 <[email protected]>
--- drivers/acpi/apei/einj-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/einj-core.c +1 -1
@@ -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;
Signature · 1 line
2.50.0
Quoted 5 lines · Colin Ian King
The check for c < 0 is always false because variable c is a
size_twhich is not a signed type. Fix this by making c assize_t.Fixes 90711f7bdf76 ("ACPI: APEI: EINJ: Create debugfs files to enter device id and syndrome")Signed-off-by Colin Ian King <[email protected]>
Reviewed-by Ira Weiny <[email protected]>
[snip]
Quoted 9 lines · Ira Weiny
Quoted 5 lines · Colin Ian King
The check for c < 0 is always false because variable c is a
size_twhich is not a signed type. Fix this by making c assize_t.Fixes 90711f7bdf76 ("ACPI: APEI: EINJ: Create debugfs files to enter device id and syndrome")Signed-off-by Colin Ian King <[email protected]>Reviewed-by Ira Weiny <[email protected]>
Applied, thanks!