diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-12-13 22:46:32 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2021-12-18 08:12:40 -0800 |
commit | abc14eb1e01286819a671019e78a23542685eee2 (patch) | |
tree | 3ec3a21b1a7e48e110839e27ff52aceefb821240 /drivers/acpi/nfit | |
parent | 7ac5360cd4d02cc7e0eaf10867f599e041822f12 (diff) | |
download | linux-abc14eb1e01286819a671019e78a23542685eee2.tar.gz linux-abc14eb1e01286819a671019e78a23542685eee2.tar.bz2 linux-abc14eb1e01286819a671019e78a23542685eee2.zip |
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>
Diffstat (limited to 'drivers/acpi/nfit')
-rw-r--r-- | drivers/acpi/nfit/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 7dd80acf92c7..e5d7f2bda13f 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -678,10 +678,12 @@ static const char *spa_type_name(u16 type) int nfit_spa_type(struct acpi_nfit_system_address *spa) { + guid_t guid; int i; + import_guid(&guid, spa->range_guid); for (i = 0; i < NFIT_UUID_MAX; i++) - if (guid_equal(to_nfit_uuid(i), (guid_t *)&spa->range_guid)) + if (guid_equal(to_nfit_uuid(i), &guid)) return i; return -1; } |