From nobody Tue Feb 10 11:32:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+64302+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64302+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1597523200; cv=none; d=zohomail.com; s=zohoarc; b=OVUrV2qRcC5uD3QtiTjsw0HbCDYb94ylKd+GxXpR0ohCeY7yJV6I43W27VSBD9ly1MGjnYJhzIugAS7QomqfGAdsgCLIA6zTTRypMKeytQDZ+q0g/CVGTO+gDANyLPpDTJh1tRDwRzNGhQJ0hevrVj8JpUEwtpO2B7G/ZFpT3IY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597523200; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=Pjr6uxMsVVMmN7uZ/6p4hzMFNgRz+RlwmeqNyjt0vRk=; b=diOmWira+r9O0GK86lKegdM5/UwefXiI74w9z2m1ki91XLluzQe9oOw0R9fy0xW9A7rU3cfdrwfOEn+XSrbSJPI+8M6pp5ee9y7N3QW4HN1dgeiES17lMiEYt93gU1KIhecld9t66aCVg7v6vVzO31aZWeI/QlVTR9cq1mFbuWk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64302+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1597523199965992.6166482338496; Sat, 15 Aug 2020 13:26:39 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6zUCYY1788612xET1t5o9lrT; Sat, 15 Aug 2020 13:26:38 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.12474.1597523193105544696 for ; Sat, 15 Aug 2020 13:26:33 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 675E8D6E; Sat, 15 Aug 2020 13:26:32 -0700 (PDT) X-Received: from U203705.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 26EC43F66B; Sat, 15 Aug 2020 13:26:32 -0700 (PDT) From: "Samer El-Haj-Mahmoud" To: devel@edk2.groups.io Cc: Leif Lindholm , Pete Batard , Andrei Warkentin , Ard Biesheuvel Subject: [edk2-devel] [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking Date: Sat, 15 Aug 2020 16:26:29 -0400 Message-Id: <20200815202631.29690-2-Samer.El-Haj-Mahmoud@arm.com> In-Reply-To: <20200815202631.29690-1-Samer.El-Haj-Mahmoud@arm.com> References: <20200815202631.29690-1-Samer.El-Haj-Mahmoud@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,samer.el-haj-mahmoud@arm.com X-Gm-Message-State: mCv388A58zVfyCAmnOSTjHGGx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1597523198; bh=ze+A9JBfdxiNcr2M6zSsYt6IgPyEfADP5EZ8BRLwfZA=; h=Cc:Date:From:Reply-To:Subject:To; b=HvqYVlbYiJWHoiBR/SSB4gDZuLwlfCO6VA7KEu9c/uCHUvTvBq9b3+BJlLUGsrCcUUt 2xRNrTNSC1ORi/r/AVck+Njopyx0Gp8ZUW31361ZzWY/RUUfPJ+mmohtDnyq7qNwywE7W 0vL88uf/qwP9q22Msnf2Xzt1dSPWQwqIMpI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Fix input param error checking for the DisplayDxe ComponentName2 protocol. This fixes https://github.com/pftf/RPi4/issues/84 Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Signed-off-by: Samer El-Haj-Mahmoud Reviewed-by: Pete Batard --- Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h | 2 ++ Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c | 22 +++++++++++++= +++++++ 2 files changed, 24 insertions(+) diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h b/Platfor= m/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h index bfbe9e868843..073f65111645 100644 --- a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h +++ b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h @@ -1,5 +1,6 @@ /** @file * + * Copyright (c) 2020, ARM Limited. All rights reserved. * Copyright (c) 2017-2018, Andrei Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. * @@ -27,6 +28,7 @@ extern EFI_GRAPHICS_OUTPUT_PROTOCOL gDisplayProto; extern EFI_COMPONENT_NAME_PROTOCOL gComponentName; extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2; +extern EFI_DRIVER_BINDING_PROTOCOL mDriverBinding; =20 VOID RegisterScreenshotHandlers ( diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c b/Plat= form/RaspberryPi/Drivers/DisplayDxe/ComponentName.c index 092230cd7c9b..4c065b5d51bf 100644 --- a/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c +++ b/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c @@ -1,5 +1,6 @@ /** @file * + * Copyright (c) 2020, ARM Limited. All rights reserved. * Copyright (c) 2018, Andrei Warkentin * Copyright (c) 2006-2016, Intel Corporation. All rights reserved. * @@ -206,6 +207,27 @@ ComponentNameGetControllerName ( OUT CHAR16 **ControllerName ) { + EFI_STATUS Status; + + // + // This is a device driver, so ChildHandle must be NULL. + // + if (ChildHandle !=3D NULL) { + return EFI_UNSUPPORTED; + } + + // + // Make sure this driver is currently managing ControllHandle + // + Status =3D EfiTestManagedDevice ( + ControllerHandle, + mDriverBinding.DriverBindingHandle, + &gEfiGraphicsOutputProtocolGuid + ); + if (EFI_ERROR (Status)) { + return Status; + } + return LookupUnicodeString2 ( Language, This->SupportedLanguages, --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#64302): https://edk2.groups.io/g/devel/message/64302 Mute This Topic: https://groups.io/mt/76213602/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-