aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorGravatar Rafael J. Wysocki <rafael.j.wysocki@intel.com> 2015-09-01 03:45:05 +0200
committerGravatar Rafael J. Wysocki <rafael.j.wysocki@intel.com> 2015-09-01 03:45:05 +0200
commit498012511a060575a56551d28a10bb392aa361b5 (patch)
treed9dd9060eb6b3037804eca8e22056e7cdb1a26dd /drivers/acpi
parentMerge branches 'acpi-pci', 'acpi-soc', 'acpi-ec' and 'acpi-osl' (diff)
parentdevice property: check fwnode type in to_of_node() (diff)
downloadlinux-498012511a060575a56551d28a10bb392aa361b5.tar.gz
linux-498012511a060575a56551d28a10bb392aa361b5.tar.bz2
linux-498012511a060575a56551d28a10bb392aa361b5.zip
Merge branch 'device-properties'
* device-properties: device property: check fwnode type in to_of_node() device property: attach 'else if' to the proper 'if' device property: fallback to pset when gettng one string device property: fix potential NULL pointer dereference
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/property.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 7836e2e980f4..6d99450549c5 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -528,13 +528,14 @@ int acpi_dev_prop_read(struct acpi_device *adev, const char *propname,
if (!val)
return obj->package.count;
- else if (nval <= 0)
- return -EINVAL;
if (nval > obj->package.count)
return -EOVERFLOW;
+ else if (nval <= 0)
+ return -EINVAL;
items = obj->package.elements;
+
switch (proptype) {
case DEV_PROP_U8:
ret = acpi_copy_property_array_u8(items, (u8 *)val, nval);