diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-09-01 03:45:05 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-09-01 03:45:05 +0200 |
commit | 498012511a060575a56551d28a10bb392aa361b5 (patch) | |
tree | d9dd9060eb6b3037804eca8e22056e7cdb1a26dd /drivers/base | |
parent | 5d2a1a927d487d6bb60c87b837d82702d8ebcaad (diff) | |
parent | 4bf011815f2e093c7f60004f4f5683cf40b905b9 (diff) | |
download | op-kernel-dev-498012511a060575a56551d28a10bb392aa361b5.zip op-kernel-dev-498012511a060575a56551d28a10bb392aa361b5.tar.gz |
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/base')
-rw-r--r-- | drivers/base/property.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/base/property.c b/drivers/base/property.c index f3f6d16..841b15c 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -27,9 +27,10 @@ */ void device_add_property_set(struct device *dev, struct property_set *pset) { - if (pset) - pset->fwnode.type = FWNODE_PDATA; + if (!pset) + return; + pset->fwnode.type = FWNODE_PDATA; set_secondary_fwnode(dev, &pset->fwnode); } EXPORT_SYMBOL_GPL(device_add_property_set); @@ -461,7 +462,8 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode, return acpi_dev_prop_read(to_acpi_node(fwnode), propname, DEV_PROP_STRING, val, 1); - return -ENXIO; + return pset_prop_read_array(to_pset(fwnode), propname, + DEV_PROP_STRING, val, 1); } EXPORT_SYMBOL_GPL(fwnode_property_read_string); |