ACPI / container: Fix error code path in container_device_attach()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 11 Feb 2014 23:52:49 +0000 (00:52 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 12 Feb 2014 13:55:16 +0000 (14:55 +0100)
commit0f6aa09e40c38d734f5d70762056116ca4a76126
treeb6c7d8d5133432e97ba9e42a6d3df94b1b828e4e
parent8fcfb99c8e29c73dd8945b6105ef54ca4eeb171e
ACPI / container: Fix error code path in container_device_attach()

To avoid leaking memory on errors from device_register(), do a
put_device() on the device object in question in the error code
path of container_device_attach().

Fixes: caa73ea158de (ACPI / hotplug / driver core: Handle containers in a special way)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
drivers/acpi/container.c