提交 6556b0a8 编写于 作者: F Furquan Shaikh 提交者: Rafael J. Wysocki

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: NFurquan Shaikh <furquan@google.com>
[ rjw: Subject edits ]
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 9123e3a7
...@@ -99,8 +99,8 @@ static int fch_misc_setup(struct apd_private_data *pdata) ...@@ -99,8 +99,8 @@ static int fch_misc_setup(struct apd_private_data *pdata)
if (ret < 0) if (ret < 0)
return -ENOENT; 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; clk_data->is_rv = obj->integer.value;
list_for_each_entry(rentry, &resource_list, node) { list_for_each_entry(rentry, &resource_list, node) {
clk_data->base = devm_ioremap(&adev->dev, rentry->res->start, clk_data->base = devm_ioremap(&adev->dev, rentry->res->start,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册