From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from huawei.com (huawei.com [45.249.212.191]) by mx.groups.io with SMTP id smtpd.web10.9451.1599641870655928661 for ; Wed, 09 Sep 2020 01:57:51 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: huawei.com, ip: 45.249.212.191, mailfrom: xiewenyi2@huawei.com) Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id BFA823B97EA59C14B5E6; Wed, 9 Sep 2020 16:57:47 +0800 (CST) Received: from HGH1000039998.huawei.com (10.184.68.188) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Wed, 9 Sep 2020 16:57:38 +0800 From: "wenyi,xie" To: , , , CC: , , , Subject: [PATCH edk2-Platform v3 1/1] Hisilicon/Smbios: Replace DEPRECATED code with S-suffixed one Date: Wed, 9 Sep 2020 16:52:29 +0800 Message-ID: <1599641549-25821-2-git-send-email-xiewenyi2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1599641549-25821-1-git-send-email-xiewenyi2@huawei.com> References: <1599641549-25821-1-git-send-email-xiewenyi2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.184.68.188] X-CFilter-Loop: Reflected Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2777 The deprecated code under DISABLE_NEW_DEPRECATED_INTERFACES will be removed, which will result in compilation breakage of the Hisilicon platforms. Prevent that by switching to S-suffixed one. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Wenyi Xie --- Notes: v3: - capture the return code [Ard] Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosType9.c = | 3 ++- Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubClass.c = | 18 +++++++++++------ Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.= c | 21 +++++++++++++------- Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunc= tion.c | 9 ++++++--- Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufact= urerFunction.c | 18 +++++++++++------ Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManuf= acturerFunction.c | 18 +++++++++++------ Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufac= turerFunction.c | 15 +++++++++----- Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type09/MiscSystemSlotDesi= gnationFunction.c | 3 ++- 8 files changed, 70 insertions(+), 35 deletions(-) diff --git a/Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosTyp= e9.c b/Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosType9.c index 57e049a41da0..5927f66d5fd1 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosType9.c +++ b/Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosType9.c @@ -135,7 +135,8 @@ AddSmbiosType9Record ( (VOID)CopyMem (SmbiosRecord, Type9Record, sizeof (SMBIOS_TABLE_TYPE9))= ; SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE9); OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - (VOID)UnicodeStrToAsciiStr (SlotDesignation, OptionalStrStart); + Status =3D UnicodeStrToAsciiStrS (SlotDesignation, OptionalStrStart, S= lotStrLen + 1); + ASSERT_EFI_ERROR (Status); =20 // // Now we have got the full smbios record, call smbios protocol to add= this record. diff --git a/Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySub= Class.c b/Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubCla= ss.c index a1af02047409..9c66eed3f3ad 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubClass.c +++ b/Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubClass.c @@ -625,12 +625,18 @@ SmbiosAddType17Table ( SmbiosGetDimmVoltageInfo (pGblData, Skt, Ch, Dimm, Type17Record); =20 OptionalStrStart =3D (CHAR8 *) (Type17Record + 1); - UnicodeStrToAsciiStr (DeviceLocatorStr, OptionalStrStart); - UnicodeStrToAsciiStr (BankLocatorStr, OptionalStrStart + DeviceLocat= orStrLen + 1); - UnicodeStrToAsciiStr (ManufactureStr, OptionalStrStart + DeviceLocat= orStrLen + 1 + BankLocatorStrLen + 1); - UnicodeStrToAsciiStr (SerialNumberStr, OptionalStrStart + DeviceLoca= torStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen + 1); - UnicodeStrToAsciiStr (AssertTagStr, OptionalStrStart + DeviceLocator= StrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen + 1 + SerialNumber= StrLen + 1); - UnicodeStrToAsciiStr (PartNumberStr, OptionalStrStart + DeviceLocato= rStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen + 1 + SerialNumbe= rStrLen + 1 + AssertTagStrLen + 1); + Status =3D UnicodeStrToAsciiStrS (DeviceLocatorStr, OptionalStrStart= , DeviceLocatorStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (BankLocatorStr, OptionalStrStart += DeviceLocatorStrLen + 1, BankLocatorStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (ManufactureStr, OptionalStrStart += DeviceLocatorStrLen + 1 + BankLocatorStrLen + 1, ManufactureStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (SerialNumberStr, OptionalStrStart = + DeviceLocatorStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen + 1= , SerialNumberStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (AssertTagStr, OptionalStrStart + D= eviceLocatorStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen + 1 + = SerialNumberStrLen + 1, AssertTagStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (PartNumberStr, OptionalStrStart + = DeviceLocatorStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen + 1 += SerialNumberStrLen + 1 + AssertTagStrLen + 1, PartNumberStrLen + 1); + ASSERT_EFI_ERROR (Status); =20 MemDevSmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; Status =3D mSmbios->Add (mSmbios, NULL, &MemDevSmbiosHandle, (EFI_SM= BIOS_TABLE_HEADER*) Type17Record); diff --git a/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/Proces= sorSubClass.c b/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/Pro= cessorSubClass.c index 647632f15ac2..275b4f0e484a 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubC= lass.c +++ b/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubC= lass.c @@ -391,7 +391,8 @@ AddSmbiosCacheTypeTable ( (VOID)CopyMem(Type7Record, &mSmbiosCacheTable[CacheLevel], sizeo= f (SMBIOS_TABLE_TYPE7)); =20 OptionalStrStart =3D (CHAR8 *) (Type7Record + 1); - UnicodeStrToAsciiStr (CacheSocketStr, OptionalStrStart); + Status =3D UnicodeStrToAsciiStrS (CacheSocketStr, OptionalStrSta= rt, CacheSocketStrLen + 1); + ASSERT_EFI_ERROR (Status); =20 SmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; Status =3D mSmbios->Add (mSmbios, NULL, &SmbiosHandle, (EFI_SMBI= OS_TABLE_HEADER *)Type7Record); @@ -610,12 +611,18 @@ AddSmbiosProcessorTypeTable ( *ProcessorId =3D ArmReadMidr(); =20 OptionalStrStart =3D (CHAR8 *) (Type4Record + 1); - UnicodeStrToAsciiStr (ProcessorSocketStr, OptionalStrStart); - UnicodeStrToAsciiStr (ProcessorManuStr, OptionalStrStart + Processor= SocketStrLen + 1); - UnicodeStrToAsciiStr (ProcessorVersionStr, OptionalStrStart + Proces= sorSocketStrLen + 1 + ProcessorManuStrLen + 1); - UnicodeStrToAsciiStr (SerialNumberStr, OptionalStrStart + ProcessorS= ocketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersionStrLen + 1); - UnicodeStrToAsciiStr (AssetTagStr, OptionalStrStart + ProcessorSocke= tStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersionStrLen + 1 + Seri= alNumberStrLen + 1); - UnicodeStrToAsciiStr (PartNumberStr, OptionalStrStart + ProcessorSoc= ketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersionStrLen + 1 + Se= rialNumberStrLen + 1 + AssetTagStrLen + 1); + Status =3D UnicodeStrToAsciiStrS (ProcessorSocketStr, OptionalStrSta= rt, ProcessorSocketStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (ProcessorManuStr, OptionalStrStart= + ProcessorSocketStrLen + 1, ProcessorManuStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (ProcessorVersionStr, OptionalStrSt= art + ProcessorSocketStrLen + 1 + ProcessorManuStrLen + 1, ProcessorVersi= onStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (SerialNumberStr, OptionalStrStart = + ProcessorSocketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersionS= trLen + 1, SerialNumberStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (AssetTagStr, OptionalStrStart + Pr= ocessorSocketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersionStrLe= n + 1 + SerialNumberStrLen + 1, AssetTagStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (PartNumberStr, OptionalStrStart + = ProcessorSocketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersionStr= Len + 1 + SerialNumberStrLen + 1 + AssetTagStrLen + 1, PartNumberStrLen += 1); + ASSERT_EFI_ERROR (Status); =20 SmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; Status =3D mSmbios->Add (mSmbios, NULL, &SmbiosHandle, (EFI_SMBIOS_T= ABLE_HEADER *)Type4Record); diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type00/MiscBi= osVendorFunction.c b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type0= 0/MiscBiosVendorFunction.c index b62ec1dd8fdf..9bdc13c96a74 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendo= rFunction.c +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendo= rFunction.c @@ -213,9 +213,12 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor) SmbiosRecord->BiosSize =3D Base2ToByteWith64KUnit(BiosPhysicalSizeHe= xValue) - 1; =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(Vendor, OptionalStrStart); - UnicodeStrToAsciiStr(Version, OptionalStrStart + VendorStrLen + 1); - UnicodeStrToAsciiStr(ReleaseDate, OptionalStrStart + VendorStrLen + = 1 + VerStrLen + 1); + Status =3D UnicodeStrToAsciiStrS (Vendor, OptionalStrStart, VendorSt= rLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (Version, OptionalStrStart + Vendor= StrLen + 1, VerStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (ReleaseDate, OptionalStrStart + Ve= ndorStrLen + 1 + VerStrLen + 1, DateStrLen + 1); + ASSERT_EFI_ERROR (Status); // // Now we have got the full smbios record, call smbios protocol to a= dd this record. // diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type01/MiscSy= stemManufacturerFunction.c b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscD= xe/Type01/MiscSystemManufacturerFunction.c index f829b09d9cb7..32bdcf1bee74 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type01/MiscSystemMan= ufacturerFunction.c +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type01/MiscSystemMan= ufacturerFunction.c @@ -135,12 +135,18 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) } =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart); - UnicodeStrToAsciiStr(ProductName, OptionalStrStart + ManuStrLen + 1= ); - UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen + 1= + PdNameStrLen + 1); - UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen + 1= + PdNameStrLen + 1 + VerStrLen + 1); - UnicodeStrToAsciiStr(SKUNumber, OptionalStrStart + ManuStrLen + 1= + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1); - UnicodeStrToAsciiStr(Family, OptionalStrStart + ManuStrLen + 1= + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + SKUNumStrLen = + 1); + Status =3D UnicodeStrToAsciiStrS (Manufacturer, OptionalStrStart, Ma= nuStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (ProductName, OptionalStrStart + M= anuStrLen + 1, PdNameStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (Version, OptionalStrStart + M= anuStrLen + 1 + PdNameStrLen + 1, VerStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (SerialNumber, OptionalStrStart + M= anuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1, SerialNumStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (SKUNumber, OptionalStrStart + M= anuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1, S= KUNumStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (Family, OptionalStrStart + M= anuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + = SKUNumStrLen + 1, FamilyStrLen + 1); + ASSERT_EFI_ERROR (Status); =20 // // Now we have got the full smbios record, call smbios protocol to a= dd this record. diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type02/MiscBa= seBoardManufacturerFunction.c b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMi= scDxe/Type02/MiscBaseBoardManufacturerFunction.c index 3834bf93f70b..278f97ddae66 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoard= ManufacturerFunction.c +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoard= ManufacturerFunction.c @@ -142,12 +142,18 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBaseBoardManufacture= r) FreePool(HandleArray); =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(BaseBoardManufacturer, OptionalStrStart); - UnicodeStrToAsciiStr(BaseBoardProductName, OptionalStrStart + ManuS= trLen + 1); - UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuS= trLen + 1 + ProductNameStrLen + 1); - UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuS= trLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1); - UnicodeStrToAsciiStr(AssetTag, OptionalStrStart + ManuS= trLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 )= ; - UnicodeStrToAsciiStr(ChassisLocation, OptionalStrStart + ManuS= trLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 += AssetTagStrLen + 1); + Status =3D UnicodeStrToAsciiStrS (BaseBoardManufacturer, OptionalStr= Start, ManuStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (BaseBoardProductName, OptionalStr= Start + ManuStrLen + 1, ProductNameStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (Version, OptionalStr= Start + ManuStrLen + 1 + ProductNameStrLen + 1, VerStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (SerialNumber, OptionalStr= Start + ManuStrLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1, SerialNum= StrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (AssetTag, OptionalStr= Start + ManuStrLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1 + SerialNu= mStrLen + 1, AssetTagStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (ChassisLocation, OptionalStr= Start + ManuStrLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1 + SerialNu= mStrLen + 1 + AssetTagStrLen + 1, ChassisLocaStrLen + 1); + ASSERT_EFI_ERROR (Status); =20 Status =3D LogSmbiosData( (UINT8*)SmbiosRecord, &SmbiosHandle); if(EFI_ERROR(Status)) diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type03/MiscCh= assisManufacturerFunction.c b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMisc= Dxe/Type03/MiscChassisManufacturerFunction.c index ec00e1cd10ad..27ad983afbcb 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type03/MiscChassisMa= nufacturerFunction.c +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type03/MiscChassisMa= nufacturerFunction.c @@ -147,11 +147,16 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer) *((UINT8 *)SmbiosRecord + sizeof (SMBIOS_TABLE_TYPE3) + ExtendLength= ) =3D 5; =20 OptionalStrStart =3D (CHAR8 *)((UINT8 *)SmbiosRecord + sizeof (SMBIO= S_TABLE_TYPE3) + ExtendLength + 1); - UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart); - UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen= + 1); - UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen= + 1 + VerStrLen + 1); - UnicodeStrToAsciiStr(AssertTag, OptionalStrStart + ManuStrLen= + 1 + VerStrLen + 1 + SerialNumStrLen + 1); - UnicodeStrToAsciiStr(ChassisSkuNumber, OptionalStrStart + ManuStrLen= + 1 + VerStrLen + 1 + SerialNumStrLen +1 + AssertTagStrLen + 1); + Status =3D UnicodeStrToAsciiStrS (Manufacturer, OptionalStrStart= , ManuStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (Version, OptionalStrStart= + ManuStrLen + 1, VerStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (SerialNumber, OptionalStrStart= + ManuStrLen + 1 + VerStrLen + 1, SerialNumStrLen + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (AssertTag, OptionalStrStart= + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1, AssertTagStrLen = + 1); + ASSERT_EFI_ERROR (Status); + Status =3D UnicodeStrToAsciiStrS (ChassisSkuNumber, OptionalStrStart= + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen +1 + AssertTagStrLen = + 1, ChaNumStrLen + 1); + ASSERT_EFI_ERROR (Status); // // Now we have got the full smbios record, call smbios protocol to a= dd this record. // diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type09/MiscSy= stemSlotDesignationFunction.c b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMi= scDxe/Type09/MiscSystemSlotDesignationFunction.c index ca1a7a2c0055..929288519780 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type09/MiscSystemSlo= tDesignationFunction.c +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type09/MiscSystemSlo= tDesignationFunction.c @@ -172,7 +172,8 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemSlotDesignation) SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE9); =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(SlotDesignation, OptionalStrStart); + Status =3D UnicodeStrToAsciiStrS (SlotDesignation, OptionalStrStart,= SlotDesignationStrLen + 1); + ASSERT_EFI_ERROR (Status); // // Now we have got the full smbios record, call smbios protocol to a= dd this record. // --=20 2.20.1.windows.1