Yes, I think this is the proper fix.  Please commit.

ok yasuoka

On Thu, 1 Jun 2017 10:41:57 +0200
Patrick Wildt <patr...@blueri.se> wrote:
> On Thu, Jun 01, 2017 at 10:27:28AM +0200, Stefan Sperling wrote:
>> On Tue, May 30, 2017 at 02:31:48PM +0200, YASUOKA Masahiko wrote:
>> > +  status = EFI_CALL(BS->LocateHandle, ByProtocol, &serio_guid, 0, &sz, 0);
>> > +  if (status == EFI_BUFFER_TOO_SMALL) {
>> > +          handles = alloc(sz);
>> > +          status = EFI_CALL(BS->LocateHandle, ByProtocol, &serio_guid,
>> > +              0, &sz, handles);
>> > +  }
>> > +  if (handles == NULL || EFI_ERROR(status))
>> > +          panic("could not get handles of serial i/o");
>> 
>> Hi,
>> 
>> On my thinkpad helix 2 the boot loader now keeps rebooting with
>> the above panic message before I can even type anything.
>> 
>> Could this panic be changed into a non-fatal error?
>> 
>> Thanks!
>> 
> 
> This should probably fix it / work around it.
> 
> diff --git a/sys/arch/amd64/stand/efiboot/efiboot.c 
> b/sys/arch/amd64/stand/efiboot/efiboot.c
> index 25e34c1a93b..998e6875f08 100644
> --- a/sys/arch/amd64/stand/efiboot/efiboot.c
> +++ b/sys/arch/amd64/stand/efiboot/efiboot.c
> @@ -526,8 +526,10 @@ efi_com_probe(struct consdev *cn)
>               status = EFI_CALL(BS->LocateHandle, ByProtocol, &serio_guid,
>                   0, &sz, handles);
>       }
> -     if (handles == NULL || EFI_ERROR(status))
> -             panic("could not get handles of serial i/o");
> +     if (handles == NULL || EFI_ERROR(status)) {
> +             free(handles, sz);
> +             return;
> +     }
>  
>       for (i = 0; i < sz / sizeof(EFI_HANDLE); i++) {
>               /*
> 

Reply via email to