Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andy Shevchenko and committed by
Dan Williams
abc14eb1 7ac5360c

+3 -1
+3 -1
drivers/acpi/nfit/core.c
··· 678 678 679 679 int nfit_spa_type(struct acpi_nfit_system_address *spa) 680 680 { 681 + guid_t guid; 681 682 int i; 682 683 684 + import_guid(&guid, spa->range_guid); 683 685 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)) 685 687 return i; 686 688 return -1; 687 689 }