mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-27 12:15:19 +01:00
fix device path length
Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
parent
90148880ac
commit
3b4ce81052
@ -67,13 +67,15 @@ CHAR8 *get_pci_dev_path(pci_dt_t *PciDt)
|
|||||||
CHAR8* tmp;
|
CHAR8* tmp;
|
||||||
CHAR16* devpathstr = NULL;
|
CHAR16* devpathstr = NULL;
|
||||||
EFI_DEVICE_PATH_PROTOCOL* DevicePath = NULL;
|
EFI_DEVICE_PATH_PROTOCOL* DevicePath = NULL;
|
||||||
|
UINTN Size;
|
||||||
|
|
||||||
DevicePath = DevicePathFromHandle (PciDt->DeviceHandle);
|
DevicePath = DevicePathFromHandle (PciDt->DeviceHandle);
|
||||||
if (!DevicePath)
|
if (!DevicePath)
|
||||||
return NULL;
|
return NULL;
|
||||||
devpathstr = FileDevicePathToStr(DevicePath);
|
devpathstr = FileDevicePathToStr(DevicePath);
|
||||||
tmp = AllocateZeroPool((StrLen(devpathstr)+1)*sizeof(CHAR16));
|
Size = StrLen(devpathstr) + 1;
|
||||||
UnicodeStrToAsciiStrS(devpathstr, tmp, (StrLen(devpathstr)+1));
|
tmp = AllocateZeroPool(Size);
|
||||||
|
UnicodeStrToAsciiStrS(devpathstr, tmp, Size);
|
||||||
return tmp;
|
return tmp;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user