aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpacpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-12 23:48:18 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-12 23:48:18 +0100
commita759012e5f9717a69c2c2f03d6c7fe435e150824 (patch)
tree4b44266e68b2047fd676201bea70f6de39a647b3 /drivers/pnp/pnpacpi
parentMerge branches 'acpi-gpe', 'acpi-video', 'acpi-thermal', 'acpi-processor', 'acpi-sleep' (diff)
parentPNPBIOS: check return value of pnp_add_device() (diff)
downloadlinux-dev-a759012e5f9717a69c2c2f03d6c7fe435e150824.tar.xz
linux-dev-a759012e5f9717a69c2c2f03d6c7fe435e150824.zip
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,