The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] ACPI: processor: fix acpi_object initialization
@ 2025-07-03 12:42 Sebastian Ott
  2025-07-03 13:28 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Ott @ 2025-07-03 12:42 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown; +Cc: linux-acpi, linux-kernel, Sebastian Ott

Initialization of the local acpi_object in acpi_processor_get_info()
only sets the first 4 bytes to zero and is thus incomplete. This is
indicated by messages like:
	acpi ACPI0007:be: Invalid PBLK length [166288104]

Fix this by initializing all 16 bytes of the processor member of that
union.

Signed-off-by: Sebastian Ott <sebott@redhat.com>
---
 drivers/acpi/acpi_processor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index 7cf6101cb4c7..2a99f5eb6962 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -275,7 +275,7 @@ static inline int acpi_processor_hotadd_init(struct acpi_processor *pr,
 
 static int acpi_processor_get_info(struct acpi_device *device)
 {
-	union acpi_object object = { 0 };
+	union acpi_object object = { .processor = { 0 } };
 	struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
 	struct acpi_processor *pr = acpi_driver_data(device);
 	int device_declaration = 0;
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ACPI: processor: fix acpi_object initialization
  2025-07-03 12:42 [PATCH] ACPI: processor: fix acpi_object initialization Sebastian Ott
@ 2025-07-03 13:28 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2025-07-03 13:28 UTC (permalink / raw)
  To: Sebastian Ott; +Cc: Rafael J . Wysocki, Len Brown, linux-acpi, linux-kernel

On Thu, Jul 3, 2025 at 2:42 PM Sebastian Ott <sebott@redhat.com> wrote:
>
> Initialization of the local acpi_object in acpi_processor_get_info()
> only sets the first 4 bytes to zero and is thus incomplete. This is
> indicated by messages like:
>         acpi ACPI0007:be: Invalid PBLK length [166288104]
>
> Fix this by initializing all 16 bytes of the processor member of that
> union.
>
> Signed-off-by: Sebastian Ott <sebott@redhat.com>
> ---
>  drivers/acpi/acpi_processor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
> index 7cf6101cb4c7..2a99f5eb6962 100644
> --- a/drivers/acpi/acpi_processor.c
> +++ b/drivers/acpi/acpi_processor.c
> @@ -275,7 +275,7 @@ static inline int acpi_processor_hotadd_init(struct acpi_processor *pr,
>
>  static int acpi_processor_get_info(struct acpi_device *device)
>  {
> -       union acpi_object object = { 0 };
> +       union acpi_object object = { .processor = { 0 } };
>         struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
>         struct acpi_processor *pr = acpi_driver_data(device);
>         int device_declaration = 0;
> --

Applied as 6.17 material, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-03 13:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-03 12:42 [PATCH] ACPI: processor: fix acpi_object initialization Sebastian Ott
2025-07-03 13:28 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox