diff options
author | Furquan Shaikh <furquan@google.com> | 2020-08-19 19:16:56 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2020-08-21 20:20:55 +0200 |
commit | 6556b0a8ef3a51ade1f772ff58807de463fc1b58 (patch) | |
tree | 0f1bce0b11b64d502d1c45f5eb7c3be5f72eaadb /drivers/acpi/acpi_apd.c | |
parent | Linux 5.9-rc1 (diff) | |
download | linux-6556b0a8ef3a51ade1f772ff58807de463fc1b58.tar.xz linux-6556b0a8ef3a51ade1f772ff58807de463fc1b58.zip |
ACPI: SoC: APD: Check return value of acpi_dev_get_property()
`fch_misc_setup()` uses `acpi_dev_get_property()` to read the value of
"is-rv" passed in by BIOS in ACPI tables. However, not all BIOSes
might pass in this property and hence it is important to first check
the return value of `acpi_dev_get_property()` before referencing the
object filled by it.
Signed-off-by: Furquan Shaikh <furquan@google.com>
[ rjw: Subject edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpi_apd.c')
-rw-r--r-- | drivers/acpi/acpi_apd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index 4c348377a39d..806b8ce05624 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -99,8 +99,8 @@ static int fch_misc_setup(struct apd_private_data *pdata) if (ret < 0) return -ENOENT; - acpi_dev_get_property(adev, "is-rv", ACPI_TYPE_INTEGER, &obj); - clk_data->is_rv = obj->integer.value; + if (!acpi_dev_get_property(adev, "is-rv", ACPI_TYPE_INTEGER, &obj)) + clk_data->is_rv = obj->integer.value; list_for_each_entry(rentry, &resource_list, node) { clk_data->base = devm_ioremap(&adev->dev, rentry->res->start, |