|
|
d772126 |
In the ac.c, lack check return value of power_supply_register().
|
|
|
d772126 |
This may casue that acpi driver's add() ops was called successful
|
|
|
d772126 |
while the device may be failed to be initalized. For example, some
|
|
|
d772126 |
ugly bios may describe two ACADs in the same dsdt. They use the same
|
|
|
d772126 |
name which will cause the second ACAD device can no be registered.
|
|
|
d772126 |
And then power_supply_register() failed. But acpi driver's add() ops
|
|
|
d772126 |
is called sucessfully. The acpi device also will receive acpi notification
|
|
|
d772126 |
and cause oops.
|
|
|
d772126 |
https://bugzilla.redhat.com/show_bug.cgi?id=772730
|
|
|
d772126 |
|
|
|
d772126 |
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
|
|
|
d772126 |
---
|
|
|
d772126 |
drivers/acpi/ac.c | 4 +++-
|
|
|
d772126 |
1 files changed, 3 insertions(+), 1 deletions(-)
|
|
|
d772126 |
|
|
|
d772126 |
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
|
|
|
d772126 |
index 6512b20..d1fcbc0 100644
|
|
|
d772126 |
--- a/drivers/acpi/ac.c
|
|
|
d772126 |
+++ b/drivers/acpi/ac.c
|
|
|
d772126 |
@@ -292,7 +292,9 @@ static int acpi_ac_add(struct acpi_device *device)
|
|
|
d772126 |
ac->charger.properties = ac_props;
|
|
|
d772126 |
ac->charger.num_properties = ARRAY_SIZE(ac_props);
|
|
|
d772126 |
ac->charger.get_property = get_ac_property;
|
|
|
d772126 |
- power_supply_register(&ac->device->dev, &ac->charger);
|
|
|
d772126 |
+ result = power_supply_register(&ac->device->dev, &ac->charger);
|
|
|
d772126 |
+ if (result)
|
|
|
d772126 |
+ goto end;
|
|
|
d772126 |
|
|
|
d772126 |
printk(KERN_INFO PREFIX "%s [%s] (%s)\n",
|
|
|
d772126 |
acpi_device_name(device), acpi_device_bid(device),
|
|
|
d772126 |
--
|
|
|
d772126 |
1.7.6.rc2.8.g28eb
|
|
|
d772126 |
|
|
|
d772126 |
--
|
|
|
d772126 |
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
|
|
|
d772126 |
the body of a message to majordomo@vger.kernel.org
|
|
|
d772126 |
More majordomo info at http://vger.kernel.org/majordomo-info.html
|