From 84edde9b2b74d9b65c127f461c44a28348b22cc8 Mon Sep 17 00:00:00 2001 From: patrick Date: Thu, 1 Jun 2017 11:32:15 +0000 Subject: [PATCH] Don't panic when we cannot locate a handle for the Serial IO protocol. Fixes reports on tech and in private. ok yasuoka@ stsp@ --- sys/arch/amd64/stand/efiboot/conf.c | 4 ++-- sys/arch/amd64/stand/efiboot/efiboot.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/arch/amd64/stand/efiboot/conf.c b/sys/arch/amd64/stand/efiboot/conf.c index c02719d1327..3b2059e414f 100644 --- a/sys/arch/amd64/stand/efiboot/conf.c +++ b/sys/arch/amd64/stand/efiboot/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.7 2017/05/31 08:40:32 yasuoka Exp $ */ +/* $OpenBSD: conf.c,v 1.8 2017/06/01 11:32:15 patrick Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -38,7 +38,7 @@ #include "efiboot.h" #include "efidev.h" -const char version[] = "3.32"; +const char version[] = "3.33"; #ifdef EFI_DEBUG int debug = 0; diff --git a/sys/arch/amd64/stand/efiboot/efiboot.c b/sys/arch/amd64/stand/efiboot/efiboot.c index 25e34c1a93b..9b6d5fc00fd 100644 --- a/sys/arch/amd64/stand/efiboot/efiboot.c +++ b/sys/arch/amd64/stand/efiboot/efiboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efiboot.c,v 1.19 2017/05/31 08:40:32 yasuoka Exp $ */ +/* $OpenBSD: efiboot.c,v 1.20 2017/06/01 11:32:15 patrick Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko @@ -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++) { /* -- 2.20.1