mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Haotian Zhang <vulab@iscas.ac.cn>
To: rmk+kernel@armlinux.org.uk
Cc: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org,
	Haotian Zhang <vulab@iscas.ac.cn>
Subject: [PATCH] adfs: Fix incorrect unsigned return type in adfs_f_getnext()
Date: Wed,  3 Dec 2025 14:51:20 +0800	[thread overview]
Message-ID: <20251203065120.652-1-vulab@iscas.ac.cn> (raw)

adfs_f_getnext() stores the return value of __adfs_dir_get() into an
unsigned int. Since __adfs_dir_get() may return negative error codes
such as -ENOENT, these values are converted into large positive numbers.

Change the return variable to type int to correctly preserve and return
negative error codes.

Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
---
 fs/adfs/dir_f.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/adfs/dir_f.c b/fs/adfs/dir_f.c
index 05e963402e25..81dedb796b56 100644
--- a/fs/adfs/dir_f.c
+++ b/fs/adfs/dir_f.c
@@ -242,7 +242,7 @@ adfs_f_setpos(struct adfs_dir *dir, unsigned int fpos)
 static int
 adfs_f_getnext(struct adfs_dir *dir, struct object_info *obj)
 {
-	unsigned int ret;
+	int ret;
 
 	ret = __adfs_dir_get(dir, dir->pos, obj);
 	if (ret == 0)
-- 
2.50.1.windows.1


             reply	other threads:[~2025-12-03  6:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03  6:51 Haotian Zhang [this message]
2025-12-03  9:13 ` Russell King (Oracle)

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=20251203065120.652-1-vulab@iscas.ac.cn \
    --to=vulab@iscas.ac.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®