diff options
| author | Krzysztof Kozlowski <k.kozlowski@samsung.com> | 2015-06-08 10:09:48 +0900 |
|---|---|---|
| committer | Sebastian Reichel <sre@kernel.org> | 2015-06-10 16:10:59 +0200 |
| commit | 5c6e3a97e969e978368df83239583771c936efea (patch) | |
| tree | 53578900b4a342b85b32e889504b7160c5ab7c1e /net/lapb/lapb_out.c | |
| parent | fb323eccbcaff06c1ed21ab989198eb40df6e846 (diff) | |
power_supply: sysfs: Bring back write to writeable properties
The fix for NULL pointer exception related to calling uevent for not
finished probe caused to set all writeable properties as non-writeable.
This was caused by checking if property is writeable before the initial
increase of power supply usage counter and in the same time using
wrapper over property_is_writeable(). The wrapper returns ENODEV if the
usage counter is still 0.
The call trace looked like:
device probe:
power_supply_register()
use_cnt = 0;
device_add()
create sysfs entries
power_supply_attr_is_visible()
power_supply_property_is_writeable()
if (use_cnt == 0) return -ENODEV;
use_cnt++;
Replace the usage of wrapper with direct call to property_is_writeable()
from driver. This should be safe call during device probe because
implementations of this callback just return 0/1 for different
properties and they do not access any of the driver's internal data.
Fixes: 8e59c7f23410 ("power_supply: Fix NULL pointer dereference during bq27x00_battery probe")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'net/lapb/lapb_out.c')
0 files changed, 0 insertions, 0 deletions
