Bluetooth: btusb: Remove redundant call to btusb_free_frags()
PATCH 1/1 Bluetooth: btusb: Remove redundant call to btusb_free_frags()
From: Johan Hedberg <[email protected]>
The btusb_disconnect() callback calls hci_unregister_dev() which in turn calls btusb_close() if the HCI device is powered. The btusb_close() function in turn will call btusb_free_frags(). It's therefore unnecessary to have another call to btusb_free_frags() in the btusb_disconnect() function. Besides the redundancy the second call seems to also cause some strange stability issues which this patch then also fixes.
--- drivers/bluetooth/btusb.c | 1 - 1 file changed, 1 deletion(-)
drivers/bluetooth/btusb.c +0 -1
@@ -2762,7 +2762,6 @@ static void btusb_disconnect(struct usb_interface *intf)else if (data->isoc)usb_driver_release_interface (&btusb_driver, data->isoc); -btusb_free_frags (data);hci_free_dev (hdev); }
Signature · 1 line
2.1.0
Marcel Holtmann
maintainerHi Johan,
Quoted 8 lines
The
btusb_disconnect()callback callshci_unregister_dev()which in turn callsbtusb_close()if the HCI device is powered. Thebtusb_close()function in turn will callbtusb_free_frags(). It's therefore unnecessary to have another call tobtusb_free_frags()in thebtusb_disconnect()function. Besides the redundancy the second call seems to also cause some strange stability issues which this patch then also fixes.
Quoted 4 lines
Signed-off-by Johan Hedberg <[email protected]>---
drivers/bluetooth/btusb.c| 1 -1 file changed, 1 deletion(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel