[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aS__MV40Vh7cXjw5@shell.armlinux.org.uk>
Date: Wed, 3 Dec 2025 09:13:21 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Haotian Zhang <vulab@...as.ac.cn>
Cc: viro@...iv.linux.org.uk, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] adfs: Fix incorrect unsigned return type in
adfs_f_getnext()
On Wed, Dec 03, 2025 at 02:51:20PM +0800, Haotian Zhang wrote:
> 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@...as.ac.cn>
The real problem here is the unsigned int -> int conversion, which is
implementation defined in C. int -> unsigned int itself is well
defined.
Reviewed-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
Thanks!
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists