linux/drivers/bluetooth
Cong Wang 54a8a79c55 btusb: fix a memory leak in btusb_send_frame()
This patch fixes the following memory leak reported by kmemleak:

unreferenced object 0xffff880060a53840 (size 192):
  comm "softirq", pid 0, jiffies 4320571771 (age 1406.569s)
  hex dump (first 32 bytes):
    01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffffff81138a1c>] create_object+0x187/0x28b
    [<ffffffff814be12e>] kmemleak_alloc+0x73/0x98
    [<ffffffff811289d3>] __kmalloc+0xfc/0x123
    [<ffffffff81386546>] usb_alloc_urb+0x1e/0x48
    [<ffffffffa0130274>] btusb_send_frame+0x86/0x385 [btusb]
    [<ffffffffa02d8230>] hci_send_frame+0xa0/0xa5 [bluetooth]
    [<ffffffffa02d8a4e>] hci_cmd_task+0xa0/0xfb [bluetooth]
    [<ffffffff81058548>] tasklet_action+0x8f/0xef
    [<ffffffff81058a4c>] __do_softirq+0xf4/0x1db
    [<ffffffff81058bb7>] run_ksoftirqd+0x84/0x129
    [<ffffffff8106f1c4>] kthread+0xa0/0xa8
    [<ffffffff814dd144>] kernel_thread_helper+0x4/0x10
    [<ffffffffffffffff>] 0xffffffffffffffff

The problem is that when inc_tx() returns non-zero, we forgot
to call usb_free_urb().

Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: "Gustavo F. Padovan" <padovan@profusion.mobi>
Signed-off-by: WANG Cong <amwang@redhat.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-03 08:19:59 +09:00
..
ath3k.c Bluetooth: ath3k: Use GFP_KERNEL instead of GFP_ATOMIC 2011-10-31 17:47:19 -02:00
bcm203x.c Bluetooth: bcm203x: Use GFP_KERNEL in workqueue 2011-10-31 17:51:57 -02:00
bfusb.c Bluetooth: bfusb: Fix error path on firmware load 2011-10-31 17:52:35 -02:00
bluecard_cs.c pcmcia: Convert pcmcia_device_id declarations to const 2011-05-06 07:46:22 +02:00
bpa10x.c Bluetooth: Use __packed annotation for drivers 2010-07-21 10:39:13 -07:00
bt3c_cs.c pcmcia: Convert pcmcia_device_id declarations to const 2011-05-06 07:46:22 +02:00
btmrvl_debugfs.c Bluetooth: Do not ignore errors returned from strict_strtol() 2011-06-10 15:04:41 -03:00
btmrvl_drv.h Bluetooth: Use __packed annotation for drivers 2010-07-21 10:39:13 -07:00
btmrvl_main.c Bluetooth: HCI devices are either BR/EDR or AMP radios 2010-10-12 12:44:51 -03:00
btmrvl_sdio.c Bluetooth: btmrvl: support Marvell Bluetooth device SD8797 2011-11-21 13:52:31 -02:00
btmrvl_sdio.h Bluetooth: btmrvl: support Marvell Bluetooth device SD8787 2011-04-13 12:20:05 -03:00
btsdio.c Bluetooth: Support SDIO devices that are AMP controllers 2010-10-12 12:44:51 -03:00
btuart_cs.c pcmcia: Convert pcmcia_device_id declarations to const 2011-05-06 07:46:22 +02:00
btusb.c btusb: fix a memory leak in btusb_send_frame() 2011-12-03 08:19:59 +09:00
btwilink.c Bluetooth: Fixed BT ST Channel reg order 2011-09-17 17:15:25 -03:00
dtl1_cs.c pcmcia: Convert pcmcia_device_id declarations to const 2011-05-06 07:46:22 +02:00
hci_ath.c Bluetooth: hci_uart: check the return value of recv() 2011-04-13 12:20:03 -03:00
hci_bcsp.c Bluetooth: Add __init and __exit marks to UART drivers 2010-07-27 12:35:58 -07:00
hci_h4.c Bluetooth: Check return value of hci_recv_stream_fragment() 2011-04-13 12:20:04 -03:00
hci_ldisc.c Revert "tty: make receive_buf() return the amout of bytes received" 2011-06-04 06:33:24 +09:00
hci_ll.c Fix common misspellings 2011-03-31 11:26:23 -03:00
hci_uart.h Bluetooth: Support for Atheros AR300x serial chip 2010-07-21 10:39:14 -07:00
hci_vhci.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
Kconfig Bluetooth: btmrvl: support Marvell Bluetooth device SD8797 2011-11-21 13:52:31 -02:00
Makefile Bluetooth: btwilink driver 2011-02-23 14:39:10 -08:00