linux-stable/drivers/bluetooth
Chris Lu d09009bc80 Bluetooth: btmtk: Fix kernel crash when entering btmtk_usb_suspend
If MediaTek's Bluetooth setup is unsuccessful, a NULL pointer issue
occur when the system is suspended and the anchored kill function
is called. To avoid this, add protection to prevent executing the
anchored kill function if the setup is unsuccessful.

[    6.922106] Hardware name: Acer Tomato (rev2) board (DT)
[    6.922114] Workqueue: pm pm_runtime_work
[    6.922132] pstate: 804000c9
(Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    6.922147] pc : usb_kill_anchored_urbs+0x6c/0x1e0
[    6.922164] lr : usb_kill_anchored_urbs+0x48/0x1e0
[    6.922181] sp : ffff800080903b60
[    6.922187] x29: ffff800080903b60
x28: ffff2c7b85c32b80 x27: ffff2c7bbb370930
[    6.922211] x26: 00000000000f4240
x25: 00000000ffffffff x24: ffffd49ece2dcb48
[    6.922255] x20: ffffffffffffffd8
x19: 0000000000000000 x18: 0000000000000006
[    6.922276] x17: 6531656337386238
x16: 3632373862333863 x15: ffff800080903480
[    6.922297] x14: 0000000000000000
x13: 303278302f303178 x12: ffffd49ecf090e30
[    6.922318] x11: 0000000000000001
x10: 0000000000000001 x9 : ffffd49ecd2c5bb4
[    6.922339] x8 : c0000000ffffdfff
x7 : ffffd49ecefe0db8 x6 : 00000000000affa8
[    6.922360] x5 : ffff2c7bbb35dd48
x4 : 0000000000000000 x3 : 0000000000000000
[    6.922379] x2 : 0000000000000000
x1 : 0000000000000003 x0 : ffffffffffffffd8
[    6.922400] Call trace:
[    6.922405]  usb_kill_anchored_urbs+0x6c/0x1e0
[    6.922422]  btmtk_usb_suspend+0x20/0x38
[btmtk 5f200a97badbdfda4266773fee49acfc8e0224d5]
[    6.922444]  btusb_suspend+0xd0/0x210
[btusb 0bfbf19a87ff406c83b87268b87ce1e80e9a829b]
[    6.922469]  usb_suspend_both+0x90/0x288
[    6.922487]  usb_runtime_suspend+0x3c/0xa8
[    6.922507]  __rpm_callback+0x50/0x1f0
[    6.922523]  rpm_callback+0x70/0x88
[    6.922538]  rpm_suspend+0xe4/0x5a0
[    6.922553]  pm_runtime_work+0xd4/0xe0
[    6.922569]  process_one_work+0x18c/0x440
[    6.922588]  worker_thread+0x314/0x428
[    6.922606]  kthread+0x128/0x138
[    6.922621]  ret_from_fork+0x10/0x20
[    6.922644] Code: f100a274 54000520 d503201f d100a260 (b8370000)
[    6.922654] ---[ end trace 0000000000000000 ]---

Fixes: ceac1cb025 ("Bluetooth: btusb: mediatek: add ISO data transmission functions")
Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Reported-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> #KernelCI
Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-26 10:53:57 -04:00
..
ath3k.c Bluetooth: ath3k: Fix multiple issues reported by checkpatch.pl 2024-05-14 10:51:05 -04:00
bcm203x.c Bluetooth: bcm203x: remove superfluous header files 2022-03-18 17:12:09 +01:00
bfusb.c Bluetooth: bfusb: fix division by zero in send path 2021-10-25 15:04:46 +02:00
bluecard_cs.c Bluetooth: Use fallthrough pseudo-keyword 2020-07-10 19:09:42 +02:00
bpa10x.c Bluetooth: bpa10x: change return value 2019-09-04 16:11:46 +02:00
bt3c_cs.c Bluetooth: bt3c_cs: Fix obsolete function 2018-09-27 12:57:39 +02:00
btbcm.c Bluetooth: btbcm: Use devm_kstrdup() 2024-03-06 17:24:06 -05:00
btbcm.h Bluetooth: hci_bcm: Add support for FW loading in autobaud mode 2022-07-21 17:04:38 -07:00
btintel_pcie.c Bluetooth: btintel_pcie: Remove unnecessary memset(0) calls 2024-07-14 21:34:29 -04:00
btintel_pcie.h Bluetooth: btintel_pcie: Refactor and code cleanup 2024-05-14 10:58:30 -04:00
btintel.c Bluetooth: btintel: Fail setup on error 2024-07-26 10:53:56 -04:00
btintel.h Bluetooth: btintel: Add firmware ID to firmware name 2024-07-14 21:34:45 -04:00
btmrvl_debugfs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_390.RULE 2022-06-10 14:51:36 +02:00
btmrvl_drv.h treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_390.RULE 2022-06-10 14:51:36 +02:00
btmrvl_main.c Bluetooth: HCI: Remove HCI_AMP support 2024-05-14 10:54:49 -04:00
btmrvl_sdio.c Bluetooth: btmrvl_sdio: drop driver owner initialization 2024-04-04 11:09:12 +02:00
btmrvl_sdio.h treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_390.RULE 2022-06-10 14:51:36 +02:00
btmtk.c Bluetooth: btmtk: Fix kernel crash when entering btmtk_usb_suspend 2024-07-26 10:53:57 -04:00
btmtk.h Bluetooth: btmtk: Mark all stub functions as inline 2024-07-15 10:13:17 -04:00
btmtksdio.c Bluetooth: btmtk: move btusb_mtk_hci_wmt_sync to btmtk.c 2024-07-15 10:11:46 -04:00
btmtkuart.c Bluetooth: btmtk: move btusb_mtk_hci_wmt_sync to btmtk.c 2024-07-15 10:11:46 -04:00
btnxpuart.c Bluetooth: btnxpuart: Fix warnings for suspend and resume functions 2024-07-15 10:12:06 -04:00
btqca.c Bluetooth: qca: Fix error code in qca_read_fw_build_info() 2024-05-14 10:51:09 -04:00
btqca.h Bluetooth: qca: clean up defines 2024-05-14 10:51:07 -04:00
btqcomsmd.c Bluetooth: btqcomsmd: Convert to platform remove callback returning void 2024-05-14 10:51:03 -04:00
btrsi.c Bluetooth: HCI: Remove HCI_AMP support 2024-05-14 10:54:49 -04:00
btrtl.c Bluetooth: Use sizeof(*pointer) instead of sizeof(type) 2024-07-14 21:34:28 -04:00
btrtl.h Bluetooth: btrtl: Add Realtek devcoredump support 2023-08-11 11:35:14 -07:00
btsdio.c Bluetooth: HCI: Remove HCI_AMP support 2024-05-14 10:54:49 -04:00
btusb.c Bluetooth: btintel: Add support for Whale Peak2 2024-07-15 10:11:57 -04:00
dtl1_cs.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
h4_recv.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
hci_ag6xx.c Bluetooth: hci_uart: Remove redundant assignment to fw_ptr 2021-06-26 07:52:41 +02:00
hci_ath.c Bluetooth: hci_uart: check for missing tty operations 2019-07-31 13:17:33 -07:00
hci_bcm4377.c Bluetooth: hci_bcm4377: Add BCM4388 support 2024-07-14 21:34:34 -04:00
hci_bcm.c Bluetooth: hci_bcm: Limit bcm43455 baudrate to 2000000 2024-05-14 10:51:05 -04:00
hci_bcsp.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
hci_h4.c Bluetooth: hci_h4: Fix padding calculation error within h4_recv_buf() 2021-11-16 13:57:25 +01:00
hci_h5.c Bluetooth: btrtl: fix out of bounds memory access 2024-03-06 17:26:21 -05:00
hci_intel.c Bluetooth: hci_intel: Fix multiple issues reported by checkpatch.pl 2024-05-14 10:51:04 -04:00
hci_ldisc.c Bluetooth: Use sizeof(*pointer) instead of sizeof(type) 2024-07-14 21:34:28 -04:00
hci_ll.c Bluetooth: hci_ll: drop of_match_ptr for ID table 2023-04-23 21:49:03 -07:00
hci_mrvl.c Bluetooth: hci_mrvl: Add serdev support for 88W8997 2023-04-23 21:45:29 -07:00
hci_nokia.c Bluetooth/nokia: Remove unused struct 'hci_nokia_radio_hdr' 2024-07-14 21:33:33 -04:00
hci_qca.c Bluetooth: hci_qca: Fix build error 2024-07-15 10:12:56 -04:00
hci_serdev.c Bluetooth: HCI: Remove HCI_AMP support 2024-05-14 10:54:49 -04:00
hci_uart.h Bluetooth: HCI: Remove HCI_AMP support 2024-05-14 10:54:49 -04:00
hci_vhci.c Bluetooth: Use sizeof(*pointer) instead of sizeof(type) 2024-07-14 21:34:28 -04:00
Kconfig Bluetooth: hci: fix build when POWER_SEQUENCING=m 2024-07-15 10:10:47 -04:00
Makefile Bluetooth: btintel_pcie: Add support for PCIe transport 2024-05-14 10:54:56 -04:00
virtio_bt.c virtio: rename virtio_find_vqs_info() to virtio_find_vqs() 2024-07-17 05:20:58 -04:00