Commit 6556b0a8 authored by Furquan Shaikh's avatar Furquan Shaikh Committed by Rafael J. Wysocki
Browse files

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: default avatarFurquan Shaikh <furquan@google.com>
[ rjw: Subject edits ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 9123e3a7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ 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);
	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) {