Re: [PATCH v3 02/12] fs: fix memory access via /dev/mem for MIPS64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 22, 2018 at 06:33:32PM +0300, Peter Mamonov wrote:
> lseek checks for non-negative in-memory offsets (addresses), failing otherwise.
> However negative address 0xffffffffXXXXXXXX is a valid MIPS64 virtual address.
> 
> Signed-off-by: Peter Mamonov <pmamonov@xxxxxxxxx>
> ---
>  fs/fs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/fs.c b/fs/fs.c
> index b66cc9b17..4322d307d 100644
> --- a/fs/fs.c
> +++ b/fs/fs.c
> @@ -962,7 +962,7 @@ loff_t lseek(int fildes, loff_t offset, int whence)
>  	case SEEK_SET:
>  		if (f->size != FILE_SIZE_STREAM && offset > f->size)
>  			goto out;
> -		if (offset < 0)
> +		if (IS_ERR(offset))

Dropped this patch. IS_ERR() takes a pointer, but offset is of type
loff_t, so gcc rightfully issues a warning.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux