Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
Battery: sysfs_remove_battery(): possible circular locking

+7 -3
+7 -3
drivers/acpi/battery.c
··· 99 99 100 100 struct acpi_battery { 101 101 struct mutex lock; 102 + struct mutex sysfs_lock; 102 103 struct power_supply bat; 103 104 struct acpi_device *device; 104 105 struct notifier_block pm_nb; ··· 574 573 575 574 static void sysfs_remove_battery(struct acpi_battery *battery) 576 575 { 577 - mutex_lock(&battery->lock); 576 + mutex_lock(&battery->sysfs_lock); 578 577 if (!battery->bat.dev) { 579 - mutex_unlock(&battery->lock); 578 + mutex_unlock(&battery->sysfs_lock); 580 579 return; 581 580 } 582 581 583 582 device_remove_file(battery->bat.dev, &alarm_attr); 584 583 power_supply_unregister(&battery->bat); 585 584 battery->bat.dev = NULL; 586 - mutex_unlock(&battery->lock); 585 + mutex_unlock(&battery->sysfs_lock); 587 586 } 588 587 589 588 /* ··· 983 982 strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); 984 983 device->driver_data = battery; 985 984 mutex_init(&battery->lock); 985 + mutex_init(&battery->sysfs_lock); 986 986 if (ACPI_SUCCESS(acpi_get_handle(battery->device->handle, 987 987 "_BIX", &handle))) 988 988 set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags); ··· 1012 1010 fail: 1013 1011 sysfs_remove_battery(battery); 1014 1012 mutex_destroy(&battery->lock); 1013 + mutex_destroy(&battery->sysfs_lock); 1015 1014 kfree(battery); 1016 1015 return result; 1017 1016 } ··· 1030 1027 #endif 1031 1028 sysfs_remove_battery(battery); 1032 1029 mutex_destroy(&battery->lock); 1030 + mutex_destroy(&battery->sysfs_lock); 1033 1031 kfree(battery); 1034 1032 return 0; 1035 1033 }