Skip to content

Commit abc14eb

Browse files
andy-shevdjbw
authored andcommitted
ACPI: NFIT: Import GUID before use
Strictly speaking the comparison between guid_t and raw buffer is not correct. Import GUID to variable of guid_t type and then compare. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20211213204632.56735-1-andriy.shevchenko@linux.intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 7ac5360 commit abc14eb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/acpi/nfit/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,10 +678,12 @@ static const char *spa_type_name(u16 type)
678678

679679
int nfit_spa_type(struct acpi_nfit_system_address *spa)
680680
{
681+
guid_t guid;
681682
int i;
682683

684+
import_guid(&guid, spa->range_guid);
683685
for (i = 0; i < NFIT_UUID_MAX; i++)
684-
if (guid_equal(to_nfit_uuid(i), (guid_t *)&spa->range_guid))
686+
if (guid_equal(to_nfit_uuid(i), &guid))
685687
return i;
686688
return -1;
687689
}

0 commit comments

Comments
 (0)