[GITLAB] - UPGRADE TO v12 on Wednesday the 18th of December at 11.30AM

  • Krzysztof Kozlowski's avatar
    power: max17040: Fix NULL pointer dereference when there is no platform_data · d15d1e03
    Krzysztof Kozlowski authored
    commit ac323d8d807060f7c95a685a9fe861e7b6300993 upstream.
    
    Fix NULL pointer dereference of "chip->pdata" if platform_data was not
    supplied to the driver.
    
    The driver during probe stored the pointer to the platform_data:
    	chip->pdata = client->dev.platform_data;
    Later it was dereferenced in max17040_get_online() and
    max17040_get_status().
    
    If platform_data was not supplied, the NULL pointer exception would
    happen:
    
    [    6.626094] Unable to handle kernel  of a at virtual address 00000000
    [    6.628557] pgd = c0004000
    [    6.632868] [00000000] *pgd=66262564
    [    6.634636] Unable to handle kernel paging request at virtual address e6262000
    [    6.642014] pgd = de468000
    [    6.644700] [e6262000] *pgd=00000000
    [    6.648265] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
    [    6.653552] Modules linked in:
    [    6.656598] CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 3.10.14-02717-gc58b4b4 #505
    [    6.664334] Workqueue: events max17040_work
    [    6.668488] task: dfa11b80 ti: df9f6000 task.ti: df9f6000
    [    6.673873] PC is at show_pte+0x80/0xb8
    [    6.677687] LR is at show_pte+0x3c/0xb8
    [    6.681503] pc : [<c001b7b8>]    lr : [<c001b774>]    psr: 600f0113
    [    6.681503] sp : df9f7d58  ip : 600f0113  fp : 00000009
    [    6.692965] r10: 00000000  r9 : 00000000  r8 : dfa11b80
    [    6.698171] r7 : df9f7ea0  r6 : e6262000  r5 : 00000000  r4 : 00000000
    [    6.704680] r3 : 00000000  r2 : e6262000  r1 : 600f0193  r0 : c05b3750
    [    6.711194] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
    [    6.718485] Control: 10c53c7d  Table: 5e46806a  DAC: 00000015
    [    6.724218] Process kworker/0:1 (pid: 31, stack limit = 0xdf9f6238)
    [    6.730465] Stack: (0xdf9f7d58 to 0xdf9f8000)
    [    6.914325] [<c001b7b8>] (show_pte+0x80/0xb8) from [<c047107c>] (__do_kernel_fault.part.9+0x44/0x74)
    [    6.923425] [<c047107c>] (__do_kernel_fault.part.9+0x44/0x74) from [<c001bb7c>] (do_page_fault+0x2c4/0x360)
    [    6.933144] [<c001bb7c>] (do_page_fault+0x2c4/0x360) from [<c0008400>] (do_DataAbort+0x34/0x9c)
    [    6.941825] [<c0008400>] (do_DataAbort+0x34/0x9c) from [<c000e5d8>] (__dabt_svc+0x38/0x60)
    [    6.950058] Exception stack(0xdf9f7ea0 to 0xdf9f7ee8)
    [    6.955099] 7ea0: df0c1790 00000000 00000002 00000000 df0c1794 df0c1790 df0c1790 00000042
    [    6.963271] 7ec0: df0c1794 00000001 00000000 00000009 00000000 df9f7ee8 c0306268 c0306270
    [    6.971419] 7ee0: a00f0113 ffffffff
    [    6.974902] [<c000e5d8>] (__dabt_svc+0x38/0x60) from [<c0306270>] (max17040_work+0x8c/0x144)
    [    6.983317] [<c0306270>] (max17040_work+0x8c/0x144) from [<c003f364>] (process_one_work+0x138/0x440)
    [    6.992429] [<c003f364>] (process_one_work+0x138/0x440) from [<c003fa64>] (worker_thread+0x134/0x3b8)
    [    7.001628] [<c003fa64>] (worker_thread+0x134/0x3b8) from [<c00454bc>] (kthread+0xa4/0xb0)
    [    7.009875] [<c00454bc>] (kthread+0xa4/0xb0) from [<c000eb28>] (ret_from_fork+0x14/0x2c)
    [    7.017943] Code: e1a03005 e2422480 e0826104 e59f002c (e7922104)
    [    7.024017] ---[ end trace 73bc7006b9cc5c79 ]---
    Signed-off-by: 's avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
    Fixes: c6f4a42dSigned-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    d15d1e03
Name
Last commit
Last update
..
avs Loading commit data...
reset Loading commit data...
88pm860x_battery.c Loading commit data...
88pm860x_charger.c Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
ab8500_bmdata.c Loading commit data...
ab8500_btemp.c Loading commit data...
ab8500_charger.c Loading commit data...
ab8500_fg.c Loading commit data...
abx500_chargalg.c Loading commit data...
apm_power.c Loading commit data...
bq2415x_charger.c Loading commit data...
bq27x00_battery.c Loading commit data...
charger-manager.c Loading commit data...
collie_battery.c Loading commit data...
da9030_battery.c Loading commit data...
da9052-battery.c Loading commit data...
ds2760_battery.c Loading commit data...
ds2780_battery.c Loading commit data...
ds2781_battery.c Loading commit data...
ds2782_battery.c Loading commit data...
generic-adc-battery.c Loading commit data...
goldfish_battery.c Loading commit data...
gpio-charger.c Loading commit data...
intel_mid_battery.c Loading commit data...
isp1704_charger.c Loading commit data...
jz4740-battery.c Loading commit data...
lp8727_charger.c Loading commit data...
lp8788-charger.c Loading commit data...
max17040_battery.c Loading commit data...
max17042_battery.c Loading commit data...
max8903_charger.c Loading commit data...
max8925_power.c Loading commit data...
max8997_charger.c Loading commit data...
max8998_charger.c Loading commit data...
olpc_battery.c Loading commit data...
pcf50633-charger.c Loading commit data...
pda_power.c Loading commit data...
pm2301_charger.c Loading commit data...
pm2301_charger.h Loading commit data...
pmu_battery.c Loading commit data...
power_supply.h Loading commit data...
power_supply_core.c Loading commit data...
power_supply_leds.c Loading commit data...
power_supply_sysfs.c Loading commit data...
rx51_battery.c Loading commit data...
s3c_adc_battery.c Loading commit data...
sbs-battery.c Loading commit data...
smb347-charger.c Loading commit data...
test_power.c Loading commit data...
tosa_battery.c Loading commit data...
tps65090-charger.c Loading commit data...
twl4030_charger.c Loading commit data...
wm831x_backup.c Loading commit data...
wm831x_power.c Loading commit data...
wm8350_power.c Loading commit data...
wm97xx_battery.c Loading commit data...
z2_battery.c Loading commit data...