On Wed, Jun 13, 2018 at 07:17:55PM +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 <pmamo...@gmail.com>
> ---
>  fs/fs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/fs/fs.c b/fs/fs.c
> index b66cc9b17..8a49e32b5 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_VALUE(offset))
>                       goto out;
>               pos = offset;
>               break;
> @@ -981,7 +981,7 @@ loff_t lseek(int fildes, loff_t offset, int whence)
>       }
>  
>       pos = fsdrv->lseek(&f->fsdev->dev, f, pos);
> -     if (pos < 0) {
> +     if (IS_ERR_VALUE(pos)) {
>               errno = -pos;
>               return -1;
>       }
> -- 
> 2.17.0
> 
> 

-- 
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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to