diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index c736186aba26..c05fb9d41a63 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -300,7 +300,8 @@ static int sco_connect(struct sock *sk) unlock: hci_dev_unlock(hdev); - hci_dev_put(hdev); + if (err) + hci_dev_put(hdev); return err; }