[CRIU] [PATCH v3] Removing Unneeded Return Value Assignments

Cyrill Gorcunov gorcunov at gmail.com
Thu Mar 21 14:18:34 MSK 2019


On Sat, Mar 16, 2019 at 02:52:04PM +0000, mitulkarnik.92 at gmail.com wrote:
> From: Mitul Karnik <mitulkarnik.92 at gmail.com>
> 
> Fixes #334: Removing Unneeded Assignments
> 
> Patch Description:
> Removed return value assignment statements as they are not referenced or used 
> anywhere after the assignment is done.
> 
> Signed-off-by: Mitul Karnik <mitulkarnik.92 at gmail.com>
> ---
>  compel/arch/s390/src/lib/infect.c | 2 +-
>  criu/path.c                       | 2 +-
>  test/zdtm/static/dumpable02.c     | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/compel/arch/s390/src/lib/infect.c b/compel/arch/s390/src/lib/infect.c
> index 940d0441..b690b812 100644
> --- a/compel/arch/s390/src/lib/infect.c
> +++ b/compel/arch/s390/src/lib/infect.c
> @@ -455,7 +455,7 @@ void *remote_mmap(struct parasite_ctl *ctl,
>  	if (ptrace_poke_area(pid, &arg_struct, where, sizeof(arg_struct))) {
>  		pr_err("Can't restore mmap args (pid: %d)\n", pid);
>  		if (map != 0) {
> -			err = compel_syscall(ctl, __NR_munmap, NULL, map,
> +			compel_syscall(ctl, __NR_munmap, NULL, map,
>  					     length, 0, 0, 0, 0);
>  			map = 0;
>  		}

This is wrong. You should rather check err and print error message
if __NR_munmap failed.


More information about the CRIU mailing list