[CRIU] [PATCH] criu: lazy-pages: don't modify variable used in a loop

Andrew Vagin avagin at virtuozzo.com
Thu Jun 16 08:02:51 PDT 2016


On Thu, Jun 16, 2016 at 12:02:00PM +0300, Mike Rapoport wrote:
> Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
> ---
>  criu/uffd.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/criu/uffd.c b/criu/uffd.c
> index 988e311..46d9be4 100644
> --- a/criu/uffd.c
> +++ b/criu/uffd.c
> @@ -729,10 +729,11 @@ static int handle_requests(int epollfd, struct epoll_event *events)
>  		}
>  
>  		for (i = 0; i < ret; i++) {
> +			int err;
>  			lpi = uffd_to_lpi(events[i].data.fd);
>  			BUG_ON(!lpi);
> -			ret = handle_user_fault(lpi, dest);
> -			if (ret < 0)
> +			err = handle_user_fault(lpi, dest);
> +			if (err < 0)
>  				goto out;

This function returns ret in this case. It is ok?
>  		}
>  	}
> -- 
> 1.9.1
> 


More information about the CRIU mailing list