linux_dsm_epyc7002/drivers/net/wireless/mediatek/mt7601u
Lorenzo Bianconi 23377c200b mt7601u: fix possible memory leak when the device is disconnected
When the device is disconnected while passing traffic it is possible
to receive out of order urbs causing a memory leak since the skb linked
to the current tx urb is not removed. Fix the issue deallocating the skb
cleaning up the tx ring. Moreover this patch fixes the following kernel
warning

[   57.480771] usb 1-1: USB disconnect, device number 2
[   57.483451] ------------[ cut here ]------------
[   57.483462] TX urb mismatch
[   57.483481] WARNING: CPU: 1 PID: 32 at drivers/net/wireless/mediatek/mt7601u/dma.c:245 mt7601u_complete_tx+0x165/00
[   57.483483] Modules linked in:
[   57.483496] CPU: 1 PID: 32 Comm: kworker/1:1 Not tainted 5.2.0-rc1+ #72
[   57.483498] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.12.0-2.fc30 04/01/2014
[   57.483502] Workqueue: usb_hub_wq hub_event
[   57.483507] RIP: 0010:mt7601u_complete_tx+0x165/0x1e0
[   57.483510] Code: 8b b5 10 04 00 00 8b 8d 14 04 00 00 eb 8b 80 3d b1 cb e1 00 00 75 9e 48 c7 c7 a4 ea 05 82 c6 05 f
[   57.483513] RSP: 0000:ffffc900000a0d28 EFLAGS: 00010092
[   57.483516] RAX: 000000000000000f RBX: ffff88802c0a62c0 RCX: ffffc900000a0c2c
[   57.483518] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff810a8371
[   57.483520] RBP: ffff88803ced6858 R08: 0000000000000000 R09: 0000000000000001
[   57.483540] R10: 0000000000000002 R11: 0000000000000000 R12: 0000000000000046
[   57.483542] R13: ffff88802c0a6c88 R14: ffff88803baab540 R15: ffff88803a0cc078
[   57.483548] FS:  0000000000000000(0000) GS:ffff88803eb00000(0000) knlGS:0000000000000000
[   57.483550] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   57.483552] CR2: 000055e7f6780100 CR3: 0000000028c86000 CR4: 00000000000006a0
[   57.483554] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   57.483556] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   57.483559] Call Trace:
[   57.483561]  <IRQ>
[   57.483565]  __usb_hcd_giveback_urb+0x77/0xe0
[   57.483570]  xhci_giveback_urb_in_irq.isra.0+0x8b/0x140
[   57.483574]  handle_cmd_completion+0xf5b/0x12c0
[   57.483577]  xhci_irq+0x1f6/0x1810
[   57.483581]  ? lockdep_hardirqs_on+0x9e/0x180
[   57.483584]  ? _raw_spin_unlock_irq+0x24/0x30
[   57.483588]  __handle_irq_event_percpu+0x3a/0x260
[   57.483592]  handle_irq_event_percpu+0x1c/0x60
[   57.483595]  handle_irq_event+0x2f/0x4c
[   57.483599]  handle_edge_irq+0x7e/0x1a0
[   57.483603]  handle_irq+0x17/0x20
[   57.483607]  do_IRQ+0x54/0x110
[   57.483610]  common_interrupt+0xf/0xf
[   57.483612]  </IRQ>

Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-06-25 08:01:03 +03:00
..
core.c
debugfs.c wireless: Use octal not symbolic permissions 2018-03-27 11:01:13 +03:00
dma.c mt7601u: fix possible memory leak when the device is disconnected 2019-06-25 08:01:03 +03:00
dma.h mt7601u: use linux/bitfield.h 2016-09-09 12:09:25 +03:00
eeprom.c mt7601u: remove a warning in mt7601u_efuse_physical_size_check() 2018-03-13 18:32:56 +02:00
eeprom.h mt7601u: bump supported EEPROM version 2019-02-01 14:28:22 +02:00
init.c mt7601u: expose 802.11w support 2018-07-30 17:30:35 +03:00
initvals_phy.h
initvals.h mt7601u: let mac80211 validate rx CCMP PN 2018-03-13 18:35:03 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mac.c mt7601u: use EWMA to calculate avg_rssi 2018-04-24 20:33:02 +03:00
mac.h mt7601u: move mt7601u_set_macaddr in mac related code 2018-02-28 16:56:05 +02:00
main.c mt7601u: use sw encryption for hw unsupported ciphers 2018-07-30 17:30:35 +03:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mcu.c Driver core patches for 4.17-rc1 2018-04-04 19:41:45 -07:00
mcu.h
mt7601u.h mt7601u: use EWMA to calculate avg_rssi 2018-04-24 20:33:02 +03:00
phy.c mt7601u: remove warning when avg_rssi is zero 2018-06-24 20:01:38 +03:00
regs.h mt7601u: wait for clear rxq when stopping mac 2016-11-29 17:32:32 +02:00
trace.c
trace.h net/mediatek: disambiguate mt76 vs mt7601u trace events 2018-03-28 22:55:18 +02:00
tx.c mt7601u: fix possible memory leak when the device is disconnected 2019-06-25 08:01:03 +03:00
usb.c mt7601u: check chip version on probe 2019-03-19 17:31:03 +02:00
usb.h mt7601u: fix dma from stack address 2015-08-10 22:19:31 +03:00
util.c