From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web12.40846.1597663044718953745 for ; Mon, 17 Aug 2020 04:17:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=imHNsOsQ; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.221.68, mailfrom: pete@akeo.ie) Received: by mail-wr1-f68.google.com with SMTP id a15so14548324wrh.10 for ; Mon, 17 Aug 2020 04:17:24 -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=/4sCMdeZQY68FGWLN11zSFHmsOYVlfpoZJdsdATZpy0=; b=imHNsOsQ7VIvLqXh7xsgJkxpuebh/rIEyaVC3anArN/qmAJ0xfqzY74b8AtZefyQVM pFkYyT4VxgmMuPTdp3IzUGgG+UZqPwBRjOnsbGaMtHNtUjgOghZEEb8UbcXzXoeCDrAI m8GMk06OfUaTaHDTfQYmLVcjCHdrWrGaUG/xyxykpfChaIVtcifiR7ng5CxZ07n9LShN 8yluA9b1WuJ96zNgp757ACrX1I0K8Qxjj3W9NibHwQXALSotUVSGJmZpqsruDr6wNcFT 23z0Xc1bJLMUcCKBG0zi+FQa4YPck1gwfuGrUFzro/fn1sccuPODKg0W/N+CzUOzpohm uAGQ== 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=/4sCMdeZQY68FGWLN11zSFHmsOYVlfpoZJdsdATZpy0=; b=oZ0ONHCYPtrl1mQ+IAZphaeFxV8djRgpQwDBx+1Hicn6ZrUO7+OICKmgglkZRoiRw3 rQaOTd8m6o0nikgmZuyj+edpq/4bKeNbJCEqvB7r1qKEsrB7v7ztYfcRqaJotaxQ0Mmg nfvRpKU/WsCvcq2lvRDrPFHSFttLPzQ3x0O/o4TfVEkc+ZQkzCaWs+HzB4bevlusttLo FIqPgpTwwwt5nDGrv9Fi+Q2cyPMq8SiNuu4zUlpv559SXrY100dR/Utif/Tm0zSX8dBF od4oBWLeYQ9KivEGwcc0GqvNyUfgPSzDNxBveMKk+73l51ppeMF0OX4lOXOlmuAPb+fm e/qw== X-Gm-Message-State: AOAM53134qbQNC8zWsDO73oeZkEvmkOFfw8kg4L+P0wuKNqPwUnWPLLg wTzAeNE5UQDd9nibsBaZCz8/Fg== X-Google-Smtp-Source: ABdhPJzQ+MzUPLkQCDlKcfIQvubNo4DZgmicKQfeOst/4QomjsB9RQeBIhaTex9UBARTHrCYoKetPg== X-Received: by 2002:a5d:54c7:: with SMTP id x7mr15894155wrv.39.1597663043392; Mon, 17 Aug 2020 04:17:23 -0700 (PDT) Return-Path: Received: from [10.0.0.122] ([84.203.54.14]) by smtp.googlemail.com with ESMTPSA id b11sm27598374wrq.32.2020.08.17.04.17.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Aug 2020 04:17:22 -0700 (PDT) Subject: Re: [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix BcmGenetDxe 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-4-Samer.El-Haj-Mahmoud@arm.com> From: "Pete Batard" Message-ID: <154d2c2b-af49-350b-edd9-6943e6928156@akeo.ie> Date: Mon, 17 Aug 2020 12:17:21 +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-4-Samer.El-Haj-Mahmoud@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Same typo as previous patch: On 2020.08.15 21:26, Samer El-Haj-Mahmoud wrote: > Fix input param error checking for the BcmGenetDxe ComponentName2 > protocol. > > This fixes https://github.com/pftf/RPi4/issues/85 > > Cc: Leif Lindholm > Cc: Pete Batard > Cc: Andrei Warkentin > Cc: Ard Biesheuvel > Signed-off-by: Samer El-Haj-Mahmoud > --- > Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h | 1 + > Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c | 22 ++++++++++++++++++++ > Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c | 2 +- > 3 files changed, 24 insertions(+), 1 deletion(-) > > diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h > index b39a1326335a..26016330fb3b 100644 > --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h > +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h > @@ -235,6 +235,7 @@ typedef struct { > > extern EFI_COMPONENT_NAME_PROTOCOL gGenetComponentName; > extern EFI_COMPONENT_NAME2_PROTOCOL gGenetComponentName2; > +extern EFI_DRIVER_BINDING_PROTOCOL mGenetDriverBinding; > > extern CONST EFI_SIMPLE_NETWORK_PROTOCOL gGenetSimpleNetworkTemplate; > extern CONST EFI_ADAPTER_INFORMATION_PROTOCOL gGenetAdapterInfoTemplate; > diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c > index 860e30b4da6b..abc5b7db16c2 100644 > --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c > +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c > @@ -2,6 +2,7 @@ > UEFI Component Name(2) protocol implementation for GENET UEFI driver. > > Copyright (c) 2020 Jared McNeill. All rights reserved. > + Copyright (c) 2020, ARM Limited. All rights reserved. > > SPDX-License-Identifier: BSD-2-Clause-Patent > **/ > @@ -169,6 +170,27 @@ GenetComponentNameGetControllerName ( > 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, > + mGenetDriverBinding.DriverBindingHandle, > + &gEfiSimpleNetworkProtocolGuid > + ); > + if (EFI_ERROR (Status)) { > + return Status; > + } > + > if (ChildHandle != NULL) { > return EFI_UNSUPPORTED; > } > diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c > index f9aa006dc799..435ef493564c 100644 > --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c > +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c > @@ -302,7 +302,7 @@ GenetDriverBindingStop ( > return EFI_SUCCESS; > } > > -STATIC EFI_DRIVER_BINDING_PROTOCOL mGenetDriverBinding = { > +EFI_DRIVER_BINDING_PROTOCOL mGenetDriverBinding = { > GenetDriverBindingSupported, > GenetDriverBindingStart, > GenetDriverBindingStop, > Reviewed-by: Pete Batard