OpenCloudOS-Kernel/drivers/power
Marcin Niestroj 362761299e power_supply: tps65217-charger: Fix NULL deref during property export
This bug leads to:

[    1.906411] Unable to handle kernel NULL pointer dereference at virtual address 0000000c
[    1.914878] pgd = c0004000
[    1.917786] [0000000c] *pgd=00000000
[    1.921536] Internal error: Oops: 5 [#1] SMP ARM
[    1.926357] Modules linked in:
[    1.929556] CPU: 0 PID: 14 Comm: kworker/0:1 Not tainted 4.4.5 #18
[    1.936006] Hardware name: Generic AM33XX (Flattened Device Tree)
[    1.942383] Workqueue: events power_supply_changed_work
[    1.947842] task: de2c41c0 ti: de2c8000 task.ti: de2c8000
[    1.953483] PC is at tps65217_ac_get_property+0x14/0x28
[    1.958937] LR is at tps65217_ac_get_property+0x10/0x28

Driver was trying to use drv_data in property get handler. However drv_data
was not set, so it caused NULL pointer dereference. This patch properly
sets drv_data during probe by power_supply_config parameter, so the
property get handler works as desired.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Fixes: 3636859b28 ("power_supply: Add support for tps65217-charger")
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-06-16 15:54:11 +02:00
..
avs PM / AVS: rockchip-io: make io-domains a child of the GRF 2016-04-26 19:12:28 +02:00
reset power: reset: at91-shdwc: add new shutdown controller driver 2016-04-10 17:17:38 +02:00
88pm860x_battery.c 88pm860x_battery: Convert to using managed resources 2015-09-22 13:35:31 +02:00
88pm860x_charger.c power_supply: 88pm860x_charger: do not pass NULL to power_supply_put 2016-03-03 15:07:22 +01:00
Kconfig power: act8945a: add charger driver for ACT8945A 2016-02-24 18:31:24 +01:00
Makefile power: act8945a: add charger driver for ACT8945A 2016-02-24 18:31:24 +01:00
ab8500_bmdata.c ab8500_bmdata: Export abx500_res_to_temp tables for hwmon 2013-04-16 17:38:10 -07:00
ab8500_btemp.c power: ab8500: convert to use match_string() helper 2016-03-17 15:09:34 -07:00
ab8500_charger.c power: ab8500: convert to use match_string() helper 2016-03-17 15:09:34 -07:00
ab8500_fg.c power: ab8500: convert to use match_string() helper 2016-03-17 15:09:34 -07:00
abx500_chargalg.c power: ab8500: convert to use match_string() helper 2016-03-17 15:09:34 -07:00
act8945a_charger.c power: act8945a: add charger driver for ACT8945A 2016-02-24 18:31:24 +01:00
apm_power.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
axp20x_usb_power.c power: Add an axp20x-usb-power driver 2015-09-22 13:35:28 +02:00
axp288_charger.c power: axp288_charger: fix for API change 2015-06-26 17:44:09 -07:00
axp288_fuel_gauge.c power: axp288_fuel_gauge: Constify platform_device_id 2015-05-23 19:44:14 +02:00
bq27xxx_battery.c power_supply: bq27xxx_battery: Add of modalias and match table when CONFIG_OF is enabled 2016-02-21 20:26:00 +01:00
bq27xxx_battery_i2c.c power supply and reset changes for the v4.6 series 2016-03-17 12:50:55 -07:00
bq2415x_charger.c power_supply: bq2415x_charger: Add of modalias and match table when CONFIG_OF is enabled 2016-02-21 20:25:49 +01:00
bq24190_charger.c power: Remove unnecessary MODULE_ALIAS() for I2C drivers 2015-09-22 13:35:30 +02:00
bq24257_charger.c power: bq24257: Add various device-specific sysfs properties 2015-09-29 16:55:03 +02:00
bq24735-charger.c power: bq24735-charger: add 'ti,external-control' option 2016-02-15 06:36:10 +01:00
bq25890_charger.c power_supply: bq25890: use flags argument of devm_gpiod_get 2015-06-13 04:06:33 +02:00
charger-manager.c power: charger_manager: convert to use match_string() helper 2016-03-17 15:09:34 -07:00
collie_battery.c power: collie_battery: hide unused variable 2016-02-15 06:01:51 +01:00
da9030_battery.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
da9052-battery.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
da9150-charger.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
da9150-fg.c power: Add support for DA9150 Fuel-Gauge 2015-10-13 11:28:07 +01:00
ds2760_battery.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
ds2780_battery.c power: ds2780_battery: clean up eeprom read/write functions 2015-07-27 16:28:54 +02:00
ds2781_battery.c power: ds2781_battery: clean up eeprom read/write functions 2015-07-27 16:28:54 +02:00
ds2782_battery.c power: ds2782_battery: constify ds278x_battery_ops structure 2015-12-05 02:06:49 +01:00
generic-adc-battery.c power: generic-adc-battery: use to_delayed_work 2016-01-07 16:38:31 +01:00
goldfish_battery.c goldfish: Enable ACPI-based enumeration for goldfish battery 2016-03-03 13:55:36 +01:00
gpio-charger.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
intel_mid_battery.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
ipaq_micro_battery.c power: ipaq-micro-battery: freeing the wrong variable 2016-04-10 17:19:52 +02:00
isp1704_charger.c power_supply: isp1704_charger: Add compatible of match for nxp,isp1707 2016-02-21 20:25:09 +01:00
jz4740-battery.c jz4740-battery: Correct voltage change check 2016-03-03 15:05:08 +01:00
lp8727_charger.c power:lp8727_charger: parsing child node after getting debounce-ms 2015-09-22 13:35:29 +02:00
lp8788-charger.c power_supply: lp8788-charger: initialize boolean 'found' 2016-03-03 15:01:49 +01:00
ltc2941-battery-gauge.c power/ltc2941-battery-gauge.c: Use the devicetree node name as supply name 2015-07-24 16:52:24 +02:00
max8903_charger.c power: max8903_charger: set IRQF_ONESHOT if no primary handler is specified 2015-12-05 02:06:50 +01:00
max8925_power.c power/max8925: freeing wrong variable 2016-04-10 17:19:33 +02:00
max8997_charger.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
max8998_charger.c power_supply: max8998: Use devm_power_supply_register 2015-09-22 16:20:10 +02:00
max14577_charger.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
max17040_battery.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
max17042_battery.c power: max17042_battery: Convert to using managed resources 2015-09-22 16:01:34 +02:00
max77693_charger.c drivers: max77693: Move state container to common header 2015-07-16 21:39:30 +01:00
olpc_battery.c power: olpc_battery: clean up eeprom read function 2015-07-27 16:28:54 +02:00
pcf50633-charger.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
pda_power.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
pm2301_charger.c power: pm2301-charger: use __maybe_unused to hide pm functions 2016-03-03 15:12:08 +01:00
pm2301_charger.h power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
pmu_battery.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
power_supply.h device.h: cleanup users outside of linux/include (C files) 2012-03-11 14:27:37 -04:00
power_supply_core.c power_supply: power_supply_read_temp only if use_cnt > 0 2016-06-14 19:25:48 +02:00
power_supply_leds.c power_supply: Use wrappers to avoid races when registering power supply 2015-05-23 20:06:19 +02:00
power_supply_sysfs.c power_supply: Add types for USB Type C and PD chargers 2016-02-15 07:02:32 +01:00
qcom_smbb.c power: qcom_smbb: test the correct variable 2015-09-24 22:35:24 +02:00
rt5033_battery.c power: Export I2C module alias information in missing drivers 2015-08-05 05:39:08 +02:00
rt9455_charger.c power: Remove unnecessary MODULE_ALIAS() for I2C drivers 2015-09-22 13:35:30 +02:00
rx51_battery.c rx51-battery: Set name to rx51-battery 2015-08-03 17:14:57 +02:00
s3c_adc_battery.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
sbs-battery.c sbs-battery: fix power status when battery charging near dry 2016-04-10 17:22:35 +02:00
smb347-charger.c power: Remove unnecessary MODULE_ALIAS() for I2C drivers 2015-09-22 13:35:30 +02:00
test_power.c power: test_power: correctly handle empty writes 2016-01-07 18:39:34 +01:00
tosa_battery.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
tps65090-charger.c tps65090-charger: Fix module autoload for OF platform driver 2015-09-22 16:03:37 +02:00
tps65217_charger.c power_supply: tps65217-charger: Fix NULL deref during property export 2016-06-16 15:54:11 +02:00
twl4030_charger.c drivers: power: twl4030_charger: fix link problems when building as module 2015-09-26 19:10:09 +02:00
twl4030_madc_battery.c power: twl4030_madc_battery: Add missing MODULE_ALIAS 2015-04-06 19:39:57 +02:00
wm97xx_battery.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
wm831x_backup.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
wm831x_power.c wm831x_power: Use IRQF_ONESHOT to request threaded IRQs 2015-09-26 18:55:09 +02:00
wm8350_power.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
z2_battery.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00