diff mbox series

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

Message ID 20240307135834.3941-3-iulia.tanasescu@nxp.com (mailing list archive)
State New, archived
Headers show
Series Bluetooth: ISO: iso_listen_bis fixes | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/SubjectPrefix success Gitlint PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Iulia Tanasescu March 7, 2024, 1:58 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 d1608387fd85..bd2271cba359 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -1134,14 +1134,14 @@  static int iso_listen_bis(struct sock *sk)
 		goto unlock;
 	}
 
-	hci_dev_put(hdev);
-
 unlock:
 	/* Unlock order should be in reverse from lock order. */
 	release_sock(sk);
 	hci_dev_unlock(hdev);
 	lock_sock(sk);
 
+	hci_dev_put(hdev);
+
 	sock_put(sk);
 
 	return err;