diff mbox series

[v2,2/2] Bluetooth: ISO: Always release hdev at the end of iso_listen_bis

Message ID 20240305140939.5090-3-iulia.tanasescu@nxp.com
State New
Headers show
Series Bluetooth: ISO: iso_listen_bis fixes | expand

Commit Message

Iulia Tanasescu March 5, 2024, 2:09 p.m. UTC
Since hci_get_route holds the device before returning, the hdev
should be released with hci_dev_put at the end of iso_listen_bis
even if the function returns with an error.

Signed-off-by: Iulia Tanasescu <iulia.tanasescu@nxp.com>
---
 net/bluetooth/iso.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index 5ca7bb0806b0..336c28cea3f7 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -1128,10 +1128,10 @@  static int iso_listen_bis(struct sock *sk)
 		goto unlock;
 	}
 
-	hci_dev_put(hdev);
-
 unlock:
 	hci_dev_unlock(hdev);
+	hci_dev_put(hdev);
+
 	return err;
 }