From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Dipendra Khadka <kdipendra88@gmail.com>,
Mikulas Patocka <mpatocka@redhat.com>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.1.y 1/3] dm-cache: remove pointless error check
Date: Thu, 26 Nov 2026 00:09:25 -0500 [thread overview]
Message-ID: <20261126050921.2111286-1-sashal@kernel.org> (raw)
In-Reply-To: <2026112510-mandatory-improve-2cc3@gregkh>
From: Dipendra Khadka <kdipendra88@gmail.com>
[ Upstream commit 4feb014bc79a42485b15bc3912dd3b0bca592520 ]
Smatch reported following:
'''
drivers/md/dm-cache-target.c:3204 parse_cblock_range() warn: sscanf doesn't return error codes
drivers/md/dm-cache-target.c:3217 parse_cblock_range() warn: sscanf doesn't return error codes
'''
Sscanf doesn't return negative values at all.
Signed-off-by: Dipendra Khadka <kdipendra88@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Stable-dep-of: df8daa4d916c ("dm cache: validate the discard block size before narrowing")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/dm-cache-target.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index d209b46fdb6fe..69ab5f9a33483 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -3323,8 +3323,6 @@ static int parse_cblock_range(struct cache *cache, const char *str,
* Try and parse form (ii) first.
*/
r = sscanf(str, "%llu-%llu%c", &b, &e, &dummy);
- if (r < 0)
- return r;
if (r == 2) {
result->begin = to_cblock(b);
@@ -3336,8 +3334,6 @@ static int parse_cblock_range(struct cache *cache, const char *str,
* That didn't work, try form (i).
*/
r = sscanf(str, "%llu%c", &b, &dummy);
- if (r < 0)
- return r;
if (r == 1) {
result->begin = to_cblock(b);
--
2.53.0
next prev parent reply other threads:[~2026-11-26 5:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 11:19 FAILED: patch "[PATCH] dm cache: validate the discard block size before narrowing" failed to apply to 6.1-stable tree gregkh
2026-11-26 5:09 ` Sasha Levin [this message]
2026-11-26 5:09 ` [PATCH 6.1.y 2/3] dm cache: parse invalidate_cblocks with kstrtouint() Sasha Levin
2026-11-26 5:09 ` [PATCH 6.1.y 3/3] dm cache: validate the discard block size before narrowing Sasha Levin
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=20261126050921.2111286-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=kdipendra88@gmail.com \
--cc=mpatocka@redhat.com \
--cc=stable@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.