Skip to content

Commit 7ab4f0e

Browse files
jmeurinrafaeljw
authored andcommitted
ACPI PPTT: Fix coding mistakes in a couple of sizeof() calls
The end of table checks should be done with the structure size, but 2 of the 3 similar calls use the pointer size. Signed-off-by: Jean-Marc Eurin <jmeurin@google.com> Link: https://patch.msgid.link/20250402001542.2600671-1-jmeurin@google.com [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0af2f6b commit 7ab4f0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/pptt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ static int acpi_pptt_leaf_node(struct acpi_table_header *table_hdr,
229229
node_entry = ACPI_PTR_DIFF(node, table_hdr);
230230
entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,
231231
sizeof(struct acpi_table_pptt));
232-
proc_sz = sizeof(struct acpi_pptt_processor *);
232+
proc_sz = sizeof(struct acpi_pptt_processor);
233233

234234
while ((unsigned long)entry + proc_sz < table_end) {
235235
cpu_node = (struct acpi_pptt_processor *)entry;
@@ -270,7 +270,7 @@ static struct acpi_pptt_processor *acpi_find_processor_node(struct acpi_table_he
270270
table_end = (unsigned long)table_hdr + table_hdr->length;
271271
entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,
272272
sizeof(struct acpi_table_pptt));
273-
proc_sz = sizeof(struct acpi_pptt_processor *);
273+
proc_sz = sizeof(struct acpi_pptt_processor);
274274

275275
/* find the processor structure associated with this cpuid */
276276
while ((unsigned long)entry + proc_sz < table_end) {

0 commit comments

Comments
 (0)