From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.groups.io with SMTP id smtpd.web10.41211.1597663034343169094 for ; Mon, 17 Aug 2020 04:17:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=AeE2Xhzc; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.221.67, mailfrom: pete@akeo.ie) Received: by mail-wr1-f67.google.com with SMTP id l2so14557317wrc.7 for ; Mon, 17 Aug 2020 04:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=JVB6jgqIo2Jjj5LRMwt+SVkpe1e3LoLe8bQFL1GJXMQ=; b=AeE2XhzcVP0Y/GOJwr1i/uQZmb+NHJ8nklAztMh8NOD8+LsbxPSaBsbDKCT4maaIVd SyUOqiH6hu8lMjS9hwyyWuxaS1cO6GK1a56a6+hD1iGdp4uoEMiyLrO3Ok43SZmCV8jY D9nWSmmj9ir51nRHaSQZmyUefDwx5hMjo3eFZVRnBCe6HIkYLvOM9hduqYdHpv18uUsS A2y6VfoEX2/qNgSbkhiST2HZPd8HTeUX0RojaVueHA1B6Pozj3mqYCaUQLwIZdEXa71c fyafSFu9v3Jb3wZXNGFWwhaR/LzVgQTNgmrhP4/BRhErdLmBL7lc1IY8IGw/LBZplTCa CIYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=JVB6jgqIo2Jjj5LRMwt+SVkpe1e3LoLe8bQFL1GJXMQ=; b=NO0pMRrbdlFhgRxN9d/2BcsYIXzH8nx0ji2k2o//tcqkq9ZSZy7t7Vj2xyjXe49jjY 4wqaxQx87PeYStFYIst5TJz8tHkijqeQpv6Peu1XIA9SxP+F9UVf7H3dhtWI1rBZ8P2R uthUZ0ys2Z193pMm6Nhl/U1JSgXj+CBGZPzVH9+2P7Jh5u4N8MCE8z3UfsUsZsP7Gmk0 y7bVrtWBeWzROX6oUZ9BhLZW7cKFpTkicPsKCVMyXd7hYMepgzrI9BhgDRoYyf7ELwOx DsmaEhms5tbNSZihcY9pRQk6x8RrD/8+lLqXlQnWpw3Y1YZVy3ZqXvqGJWtuf5NxEnpM NZYg== X-Gm-Message-State: AOAM530ysNQjE1C1yh4YNMmx7+NIVNajmQxCgbCHOsGcSSUwVD3U9QK1 PgRNOYa8XySs90iEz5/JG/7vSw== X-Google-Smtp-Source: ABdhPJza8NTAyj8jFeN+X4TaI/3YsZJ0/y40nbsEFgH6ue8Oi6nLPThsAn5qp5Kc0OS3Zz4qWzOhhg== X-Received: by 2002:adf:b34a:: with SMTP id k10mr14643853wrd.402.1597663032931; Mon, 17 Aug 2020 04:17:12 -0700 (PDT) Return-Path: Received: from [10.0.0.122] ([84.203.54.14]) by smtp.googlemail.com with ESMTPSA id v7sm12286667wmj.28.2020.08.17.04.17.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Aug 2020 04:17:12 -0700 (PDT) Subject: Re: [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking To: Samer El-Haj-Mahmoud , devel@edk2.groups.io Cc: Leif Lindholm , Andrei Warkentin , Ard Biesheuvel References: <20200815202631.29690-1-Samer.El-Haj-Mahmoud@arm.com> <20200815202631.29690-2-Samer.El-Haj-Mahmoud@arm.com> From: "Pete Batard" Message-ID: Date: Mon, 17 Aug 2020 12:17:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200815202631.29690-2-Samer.El-Haj-Mahmoud@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit One typo: On 2020.08.15 21:26, Samer El-Haj-Mahmoud wrote: > 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 > --- > 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/Platform/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; > > VOID > RegisterScreenshotHandlers ( > diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c b/Platform/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 != NULL) { > + return EFI_UNSUPPORTED; > + } > + > + // > + // Make sure this driver is currently managing ControllHandle Shouldn't it be 'ControllerHandle' rather than 'ControllHandle'? > + // > + Status = EfiTestManagedDevice ( > + ControllerHandle, > + mDriverBinding.DriverBindingHandle, > + &gEfiGraphicsOutputProtocolGuid > + ); > + if (EFI_ERROR (Status)) { > + return Status; > + } > + > return LookupUnicodeString2 ( > Language, > This->SupportedLanguages, > Reviewed-by: Pete Batard