Reviewed-by: Nickle Wang <nick...@nvidia.com>

Regards,
Nickle

> -----Original Message-----
> From: abner.ch...@amd.com <abner.ch...@amd.com>
> Sent: Monday, November 27, 2023 1:31 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang <nick...@nvidia.com>; Igor Kulchytskyy <ig...@ami.com>;
> Mike Maslenkin <mike.maslen...@gmail.com>
> Subject: [PATCH V3 8/9] RedfishPkg/HostInterfaceBmcUsbNic: Fix incorrect HI
> protocol record size
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang <abner.ch...@amd.com>
> 
> The size of structure must be minus with byte that is occupied by the initial 
> array.
> 
> Signed-off-by: Abner Chang <abner.ch...@amd.com>
> Cc: Nickle Wang <nick...@nvidia.com>
> Cc: Igor Kulchytskyy <ig...@ami.com>
> Cc: Mike Maslenkin <mike.maslen...@gmail.com>
> ---
>  .../PlatformHostInterfaceBmcUsbNicLib.c                       | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git
> a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfac
> eBmcUsbNicLib.c
> b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfac
> eBmcUsbNicLib.c
> index c4a71226e63..a1ce2dd3d93 100644
> ---
> a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfac
> eBmcUsbNicLib.c
> +++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostI
> +++ nterfaceBmcUsbNicLib.c
> @@ -180,7 +180,7 @@ RedfishPlatformHostInterfaceProtocolData (
>        HostNameLength     = (UINT8)AsciiStrSize (HostNameString);
>        ThisProtocolRecord = (MC_HOST_INTERFACE_PROTOCOL_RECORD
> *)AllocateZeroPool (
>                                                                    sizeof
> (MC_HOST_INTERFACE_PROTOCOL_RECORD) - 1 +
> -                                                                  sizeof
> (REDFISH_OVER_IP_PROTOCOL_DATA) +
> +
> + sizeof (REDFISH_OVER_IP_PROTOCOL_DATA) - 1 +
>                                                                    
> HostNameLength
>                                                                    );
>        if (ThisProtocolRecord == NULL) { @@ -189,7 +189,7 @@
> RedfishPlatformHostInterfaceProtocolData (
>        }
> 
>        ThisProtocolRecord->ProtocolType        =
> MCHostInterfaceProtocolTypeRedfishOverIP;
> -      ThisProtocolRecord->ProtocolTypeDataLen = sizeof
> (REDFISH_OVER_IP_PROTOCOL_DATA) + HostNameLength;
> +      ThisProtocolRecord->ProtocolTypeDataLen = sizeof
> + (REDFISH_OVER_IP_PROTOCOL_DATA) -1 + HostNameLength;
>        RedfishOverIpData                       = 
> (REDFISH_OVER_IP_PROTOCOL_DATA
> *)&ThisProtocolRecord->ProtocolTypeData[0];
>        //
>        // Fill up REDFISH_OVER_IP_PROTOCOL_DATA
> --
> 2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112015): https://edk2.groups.io/g/devel/message/112015
Mute This Topic: https://groups.io/mt/102824325/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to