From nobody Thu May 25 04:34:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRZvL2dj4z4Ccdf; Thu, 25 May 2023 04:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRZvL1v8Sz49fn; Thu, 25 May 2023 04:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684989246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QwBtSh2VzvryGL6PgubI/8dXnnfI9sw4eXdYw178chw=; b=k4n+6eR6uRRzrQSnxjT0j3rsrlSEOtl9DnVh0BApDBCqS3u1BdqoLfqmcIoNG3WRcxReUX sSsL06varrPnmaG4ldeRrgpRKfO7C2eMSHT+b6YNqK4CAWUJPUihekBpvPgrBOMRK9TMiO akM7U99tflG8sI5blrROoc24zqgPmUry+Bbznk7X57Jt2isssGn2wKf44uPuqD/Eads3XG aT4yDVFNoW9HziHN10FFcnbBM0Y9UnHrpCcIYHuY07euly5Zt4uTHQwjb/2Iz8uH1hGlvQ Hva+c1CncYDclOrFHyp6cGZORFLCZ0kq8rUiCRz172gNSdscGInBBvaGO9Wc7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684989246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QwBtSh2VzvryGL6PgubI/8dXnnfI9sw4eXdYw178chw=; b=GCZGodRSpu2mESCnhdfK2R3rVI9WOKt376kyWIA2fHRkJSB9m/A/I4D26kD9xrRUMyIsKz PpzrYt1IyB9ZBKU18dPAmytGgwXrAHKlegvz0NNnnY9AWxdvqKlHkuUVF2KjmWXL13phgN uDBd2k6Dj8CRlOeJaITRYVnsWoNf99XwzbbKs2A4n99pMsbBv+f7StkJegP4NhLmm0jJgz gyf8ebF8bioAbIqcf875yFSzuYyeYcLWuDZecPfq3ozNrLJni9Ef5xppETIYGECMW6wqry S1WEt0C0OLTHcQKHTueeL6xXcPvhNnnjna0UIVW4La64iq3dG3VH3J+c3F2QVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684989246; a=rsa-sha256; cv=none; b=VG6HngiY/Kzhud7wBUR6zy016S/5CtSyGMYSY9M7DGgLtabcPtVKJYPtYkez91vOBl7q9X 2CqTeCDgfJpnQvG32ERSXchB9IpxzwwvA2xZH1mC8lC//I0jUbWSdPnLE/51JrqLf2gcxz KLgHg2TjPw2QBNwP+qWAV7XJMgeMZqMK9Zsh6Wyiwj2Ylgr4Oixfn0KHN2cedRYWlUpRya YCcsIH1PCt7Ld+i5C2f/RyykCLrC+YvRhJdnd1m9QuVM92DLBuF4dntzlf5xDuYWQ4PYkY 84N7oPN+PEcjC5SyS66q0hiKVwuSEWZV8EG3WzAqhOyjLt8/FbrbkqOD8AKuig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRZvL0rRnz19ml; Thu, 25 May 2023 04:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34P4Y6uR089345; Thu, 25 May 2023 04:34:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34P4Y6hU089344; Thu, 25 May 2023 04:34:06 GMT (envelope-from git) Date: Thu, 25 May 2023 04:34:06 GMT Message-Id: <202305250434.34P4Y6hU089344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 46927f674466 - main - stand/efi/eficom: Free comc_port if we can't find the serial port List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46927f674466965db76f8e3138bcc630cdd6ed11 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=46927f674466965db76f8e3138bcc630cdd6ed11 commit 46927f674466965db76f8e3138bcc630cdd6ed11 Author: Warner Losh AuthorDate: 2023-05-24 22:34:51 +0000 Commit: Warner Losh CommitDate: 2023-05-25 04:33:53 +0000 stand/efi/eficom: Free comc_port if we can't find the serial port If we can't find the serial port, free comc_port and return early. The serial port just isn't there. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D40223 --- stand/efi/libefi/eficom.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stand/efi/libefi/eficom.c b/stand/efi/libefi/eficom.c index 6ff8512dedd7..4c104114d445 100644 --- a/stand/efi/libefi/eficom.c +++ b/stand/efi/libefi/eficom.c @@ -329,6 +329,16 @@ comc_probe(struct console *sc) } } + /* + * If there's no sio, then the device isn't there, so just return since + * the present flags aren't yet set. + */ + if (comc_port->sio == NULL) { + free(comc_port); + comc_port = NULL; + return; + } + if (env != NULL) unsetenv("efi_com_port"); snprintf(value, sizeof (value), "%u", comc_port->ioaddr);