[PATCH v2 2/6] kexec: don't die during buffer finding

Eric W. Biederman ebiederm at xmission.com
Mon Nov 19 12:05:05 EST 2012


Yinghai Lu <yinghai at kernel.org> writes:

> could return 0, and let the caller retry with new ranges.

And in 3 lines of code you have broken. all callers of
add_buffer_phys_virt.

If you are going to remove the die here you need to push it into all of
the callers that don't have any other error handling.

Eric

> Signed-off-by: Yinghai Lu <yinghai at kernel.org>
> ---
>  kexec/kexec.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/kexec/kexec.c b/kexec/kexec.c
> index 8928be0..0f8aec8 100644
> --- a/kexec/kexec.c
> +++ b/kexec/kexec.c
> @@ -366,10 +366,9 @@ unsigned long add_buffer_phys_virt(struct kexec_info *info,
>  	memsz = (memsz + (pagesize - 1)) & ~(pagesize - 1);
>  
>  	base = locate_hole(info, memsz, buf_align, buf_min, buf_max, buf_end);
> -	if (base == ULONG_MAX) {
> -		die("locate_hole failed\n");
> -	}
> -	
> +	if (base == ULONG_MAX)
> +		return 0;
> +
>  	add_segment_phys_virt(info, buf, bufsz, base, memsz, phys);
>  	return base;
>  }



More information about the kexec mailing list