Skip to content

Commit ed95885

Browse files
ea1davisVudentz
authored andcommitted
Bluetooth: SCO: remove the redundant sco_conn_put
When adding conn, it is necessary to increase and retain the conn reference count at the same time. Another problem was fixed along the way, conn_put is missing when hcon is NULL in the timeout routine. Fixes: e672077 ("Bluetooth: SCO: Use kref to track lifetime of sco_conn") Reported-and-tested-by: syzbot+489f78df4709ac2bfdd3@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=489f78df4709ac2bfdd3 Signed-off-by: Edward Adam Davis <eadavis@qq.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent a66dfaf commit ed95885

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/bluetooth/sco.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ static void sco_sock_timeout(struct work_struct *work)
143143
sco_conn_lock(conn);
144144
if (!conn->hcon) {
145145
sco_conn_unlock(conn);
146+
sco_conn_put(conn);
146147
return;
147148
}
148149
sk = sco_sock_hold(conn);
@@ -192,7 +193,6 @@ static struct sco_conn *sco_conn_add(struct hci_conn *hcon)
192193
conn->hcon = hcon;
193194
sco_conn_unlock(conn);
194195
}
195-
sco_conn_put(conn);
196196
return conn;
197197
}
198198

0 commit comments

Comments
 (0)