[ACPI] Do not panic if ProcessorNameString does not exist

Windows does not create this value in the registry if the processor core
does not expose the Brand String. It's an optional value and existing code
accessing it already has proper NULL checks:
https://git.reactos.org/?p=reactos.git;a=blob;f=drivers/bus/acpi/buspdo.c;hb=b96e88894a4d55f5e8b94430deeb0f086151b24f#l748

This is the proper fix for regression in CORE-7952.
Addendum to 48912992 (r61666) and 4d992804 (r62642).

CORE-17413
This commit is contained in:
Stanislav Motylkov 2020-12-30 02:40:03 +03:00
parent 740beb65e6
commit c57d0b7b98
No known key found for this signature in database
GPG key ID: AFE513258CBA9E92

View file

@ -520,32 +520,29 @@ GetProcessorInformation(VOID)
NULL,
NULL,
&Length);
if (!NT_SUCCESS(Status))
if (NT_SUCCESS(Status))
{
DPRINT1("Failed to query ProcessorNameString value: 0x%lx\n", Status);
goto done;
}
/* Allocate a buffer large enough to be zero terminated */
Length += sizeof(UNICODE_NULL);
ProcessorNameString = ExAllocatePoolWithTag(PagedPool, Length, 'IpcA');
if (ProcessorNameString == NULL)
{
DPRINT1("Failed to allocate 0x%lx bytes\n", Length);
Status = STATUS_INSUFFICIENT_RESOURCES;
goto done;
}
/* Allocate a buffer large enough to be zero terminated */
Length += sizeof(UNICODE_NULL);
ProcessorNameString = ExAllocatePoolWithTag(PagedPool, Length, 'IpcA');
if (ProcessorNameString == NULL)
{
DPRINT1("Failed to allocate 0x%lx bytes\n", Length);
Status = STATUS_INSUFFICIENT_RESOURCES;
goto done;
}
/* Query the processor name string */
Status = AcpiRegQueryValue(ProcessorHandle,
L"ProcessorNameString",
NULL,
ProcessorNameString,
&Length);
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to query ProcessorNameString value: 0x%lx\n", Status);
goto done;
/* Query the processor name string */
Status = AcpiRegQueryValue(ProcessorHandle,
L"ProcessorNameString",
NULL,
ProcessorNameString,
&Length);
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to query ProcessorNameString value: 0x%lx\n", Status);
goto done;
}
}
/* Query the vendor identifier length */