summaryrefslogtreecommitdiff
path: root/drivers/pnp/pnpacpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-13 02:48:18 +0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-13 02:48:18 +0400
commita759012e5f9717a69c2c2f03d6c7fe435e150824 (patch)
tree4b44266e68b2047fd676201bea70f6de39a647b3 /drivers/pnp/pnpacpi
parentbcc7201a91176f815f48f8ad889a20c5c829d9a9 (diff)
parentd8254e0e72c8cc6131f789f8645338b719f57648 (diff)
downloadlinux-a759012e5f9717a69c2c2f03d6c7fe435e150824.tar.xz
Merge branch 'pnp'
* pnp: PNPBIOS: check return value of pnp_add_device() PNP: Mark the function pnp_build_option() as static in resource.c PNP / card: add missing put_device() call PNPACPI: check return value of pnp_add_device()
Diffstat (limited to 'drivers/pnp/pnpacpi')
-rw-r--r--drivers/pnp/pnpacpi/core.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index 156d14e2587e..9f611cbbc294 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -241,6 +241,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
struct pnp_dev *dev;
char *pnpid;
struct acpi_hardware_id *id;
+ int error;
/* Skip devices that are already bound */
if (device->physical_node_count)
@@ -299,10 +300,16 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
/* clear out the damaged flags */
if (!dev->active)
pnp_init_resources(dev);
- pnp_add_device(dev);
+
+ error = pnp_add_device(dev);
+ if (error) {
+ put_device(&dev->dev);
+ return error;
+ }
+
num++;
- return AE_OK;
+ return 0;
}
static acpi_status __init pnpacpi_add_device_handler(acpi_handle handle,