• Kiran K's avatar
    Bluetooth: btinel: Check ACPI handle for NULL before accessing · 902160cd
    Kiran K authored
    Older platforms and Virtual platforms which doesn't have support for
    bluetooth device in ACPI firmware will not have valid ACPI handle.
    Check for validity of handle before accessing.
    
    dmesg log from simics environment (virtual platform):
    
    BUG: unable to handle kernel NULL pointer dereference at
    0000000000000018
    IP: acpi_ns_walk_namespace+0x5c/0x278
    PGD 0 P4D 0
    Oops: 0000 [#1] SMP PTI
    Modules linked in: bnep intel_powerclamp coretemp kvm_intel
    kvm irqbypass intel_cstate input_leds joydev serio_raw mac_hid
    btusb(OE) btintel(OE) bluetooth(OE) lpc_ich compat(OE) ecdh_generic
    i7core_edac i5500_temp shpchp binfmt_misc sch_fq_codel parport_pc ppdev
    lp parport ip_tables x_tables autofs4 hid_generic usbhid hid e1000e
    psmouse ahci pata_acpi libahci ptp pps_core floppy
    CPU: 0 PID: 35 Comm: kworker/u3:0 Tainted: G           OE
    4.15.0-140-generic #144-Ubuntu
    Hardware name: Simics Simics, BIOS Simics 01/01/2011
    Workqueue: hci0 hci_power_on [bluetooth]
    RIP: 0010:acpi_ns_walk_namespace+0x5c/0x278
    RSP: 0000:ffffaa9c0049bba8 EFLAGS: 00010246
    RAX: 0000000000000001 RBX: 0000000000001001 RCX: 0000000000000010
    RDX: ffffffff92ea7e27 RSI: ffffffff92ea7e10 RDI: 00000000000000c8
    RBP: ffffaa9c0049bbf8 R08: 0000000000000000 R09: ffffffffc05b39d0
    R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000001
    R13: 0000000000000000 R14: ffffffffc05b39d0 R15: ffffaa9c0049bc70
    FS:  0000000000000000(0000) GS:ffff8be73fc00000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000000018 CR3: 0000000075f0e000 CR4: 00000000000006f0
    
    Fixes: 294d749b ("Bluetooth: btintel: Iterate only bluetooth device ACPI entries")
    Signed-off-by: default avatarKiran K <kiran.k@intel.com>
    Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
    902160cd
btintel.c 72 KB