From: Colin Ian King <colin.i.king@gmail.com>
To: "Hugh Dickins" <hughd@google.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Gabriel Krisman Bertazi" <gabriel@krisman.be>,
"Christian Brauner" <brauner@kernel.org>,
"André Almeida" <andrealmeid@igalia.com>,
linux-mm@kvack.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] mm: shmem: Fix error checking on utf8_parse_version failures
Date: Tue, 12 Nov 2024 09:54:49 +0000 [thread overview]
Message-ID: <20241112095449.461196-1-colin.i.king@gmail.com> (raw)
Currently the error check on the call to utf8_parse_version is always
false because version is an unsigned int and this can never be less
than zero. Because version is required to be an unsigned int, fix the
issue by casting it to int just for the error check.
Fixes: 58e55efd6c72 ("tmpfs: Add casefold lookup support")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
mm/shmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index 7987deb2be9b..b69e1d8816fa 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -4377,7 +4377,7 @@ static int shmem_parse_opt_casefold(struct fs_context *fc, struct fs_parameter *
"in the format: utf8-<version number>");
version = utf8_parse_version(version_str);
- if (version < 0)
+ if ((int)version < 0)
return invalfc(fc, "Invalid UTF-8 version: %s", version_str);
}
--
2.39.5
next reply other threads:[~2024-11-12 9:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 9:54 Colin Ian King [this message]
2024-11-12 10:06 ` André Almeida
2024-11-12 10:12 ` Colin King (gmail)
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=20241112095449.461196-1-colin.i.king@gmail.com \
--to=colin.i.king@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andrealmeid@igalia.com \
--cc=brauner@kernel.org \
--cc=gabriel@krisman.be \
--cc=hughd@google.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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