Skip to contentSkip to conversation

Bluetooth: btusb: Remove redundant call to btusb_free_frags()

PATCH In review Johan Hedberg 2 participants 2 messages Jan 28, 2015 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

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
index 4fac6927ee11..271db881e793 100644
@@ -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
maintainer
#1 lore raw

Hi Johan,

Quoted 8 lines

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.

Quoted 4 lines

---
drivers/bluetooth/btusb.c | 1 -

1 file changed, 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel