ACPI PPTT: Fix typos in a couple of sizeof() calls.
PATCH 1/1 ACPI PPTT: Fix typos 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 <[email protected]>
--- drivers/acpi/pptt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/pptt.c +2 -2
@@ -229,7 +229,7 @@ static int acpi_pptt_leaf_node(struct acpi_table_header *table_hdr, node_entry =ACPI_PTR_DIFF (node, table_hdr); entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,sizeof (struct acpi_table_pptt )); - proc_sz =sizeof (struct acpi_pptt_processor *); + proc_sz =sizeof (struct acpi_pptt_processor );while ((unsigned long )entry + proc_sz < table_end) { cpu_node = (struct acpi_pptt_processor *)entry;
@@ -270,7 +270,7 @@ static struct acpi_pptt_processor *acpi_find_processor_node(struct acpi_table_he table_end = (unsigned long )table_hdr + table_hdr->length; entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,sizeof (struct acpi_table_pptt )); - proc_sz =sizeof (struct acpi_pptt_processor *); + proc_sz =sizeof (struct acpi_pptt_processor );/* find the processor structure associated with this cpuid */ while ((unsigned long )entry + proc_sz < table_end) {
Signature · 1 line
2.49.0.472.ge94155a9ec-goog
Quoted 23 lines · Jean-Marc Eurin
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 <[email protected]>--- drivers/acpi/pptt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/acpi/pptt.c +1
-1@@ -229,7 +229,7 @@ static int acpi_pptt_leaf_node(struct acpi_table_header *table_hdr, node_entry =ACPI_PTR_DIFF (node, table_hdr); entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,sizeof (struct acpi_table_pptt )); - proc_sz =sizeof (struct acpi_pptt_processor *); + proc_sz =sizeof (struct acpi_pptt_processor );while ((unsigned long )entry + proc_sz < table_end) { cpu_node = (struct acpi_pptt_processor *)entry;
drivers/acpi/pptt.c static struct acpi_pptt_processor *acpi_find_processor_node(struct acpi_table_he
Quoted 9 lines
drivers/acpi/pptt.c +1
-2@@ -270,7 +270,7 @@ static struct acpi_pptt_processor *acpi_find_processor_node(struct acpi_table_he table_end = (unsigned long )table_hdr + table_hdr->length; entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,sizeof (struct acpi_table_pptt )); - proc_sz =sizeof (struct acpi_pptt_processor *); + proc_sz =sizeof (struct acpi_pptt_processor );/* find the processor structure associated with this cpuid */ while ((unsigned long )entry + proc_sz < table_end) { --
Applied as 6.15-rc material with a couple of edits in the subject.
Thanks!