Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Apr 2023 09:38:48 +0000
From:      Gary Jennejohn <garyj@gmx.de>
To:        Gleb Smirnoff <glebius@FreeBSD.org>
Cc:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: 4358928e235c - main - amd64 loader: plug hard hang with serial console enabled
Message-ID:  <20230401113848.3dc4fd8a@ernst.home>
In-Reply-To: <202303311823.32VINOlr027796@gitrepo.freebsd.org>
References:  <202303311823.32VINOlr027796@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 31 Mar 2023 18:23:24 GMT
Gleb Smirnoff <glebius@FreeBSD.org> wrote:

> The branch main has been updated by glebius:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D4358928e235c1e188ad6b4650=
d78bcceb225b909
>
> commit 4358928e235c1e188ad6b4650d78bcceb225b909
> Author:     Gleb Smirnoff <glebius@FreeBSD.org>
> AuthorDate: 2023-03-31 18:19:25 +0000
> Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
> CommitDate: 2023-03-31 18:19:25 +0000
>
>     amd64 loader: plug hard hang with serial console enabled
>
>     The hang basically bricks a physical box and it can be recovered
>     only if you are able to boot from alternate media.  This isn't a
>     perfect fix, but throw it in before loader experts decide on
>     proper one.
>
>     Submitted by:   whu
>     Fixes:          927358dd98cb902160093e0dc0bac002d6b43858
> ---
>  stand/efi/loader/efiserialio.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/stand/efi/loader/efiserialio.c b/stand/efi/loader/efiserial=
io.c
> index 5fbc700f6ac2..0f37ef8b87dd 100644
> --- a/stand/efi/loader/efiserialio.c
> +++ b/stand/efi/loader/efiserialio.c
> @@ -265,6 +265,8 @@ comc_probe(struct console *sc)
>  	 */
>  	env =3D getenv("smbios.bios.version");
>  	if (env =3D=3D NULL || strncmp(env, "Hyper-V", 7) !=3D 0) {
> +		/* Disable being seen as "comconsole". */
> +		comconsole.c_name =3D "efiserialio";
>  		return;
>  	}
>  #endif
>

What if env is NULL?  Shouldn't the code return without changing anything?

Seems to me that this if() should be split into two if() clauses.

=2D-
Gary Jennejohn



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20230401113848.3dc4fd8a>