diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-12 23:48:18 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-12 23:48:18 +0100 |
commit | a759012e5f9717a69c2c2f03d6c7fe435e150824 (patch) | |
tree | 4b44266e68b2047fd676201bea70f6de39a647b3 /drivers/pnp/pnpacpi | |
parent | bcc7201a91176f815f48f8ad889a20c5c829d9a9 (diff) | |
parent | d8254e0e72c8cc6131f789f8645338b719f57648 (diff) | |
download | linux-a759012e5f9717a69c2c2f03d6c7fe435e150824.tar.bz2 |
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.c | 11 |
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, |