Message ID | 20230503133937.169647-2-lrh2000@pku.edu.cn |
---|---|
State | Accepted |
Commit | 2910431ab0e500dfc5df12299bb15eef0f30b43e |
Headers | show |
Series | [v4,1/4] Bluetooth: Fix potential double free caused by hci_conn_unlink | expand |
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 70e1655a9..44d0643fc 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -1102,12 +1102,12 @@ static void hci_conn_unlink(struct hci_conn *conn) if (!conn->link) return; - hci_conn_put(conn->parent); - conn->parent = NULL; - list_del_rcu(&conn->link->list); synchronize_rcu(); + hci_conn_put(conn->parent); + conn->parent = NULL; + kfree(conn->link); conn->link = NULL; }