浏览代码

Bluetooth: Fix memory leak under page timeouts

If the remote device is not present, the connections attemp fails and
the struct hci_conn was not freed

Signed-off-by: Tomas Targownik <ttargownik@geicp.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Tomas Targownik 14 年之前
父节点
当前提交
163f4dabea
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      net/bluetooth/hci_conn.c

+ 3 - 0
net/bluetooth/hci_conn.c

@@ -393,6 +393,9 @@ int hci_conn_del(struct hci_conn *conn)
 
 	hci_dev_put(hdev);
 
+	if (conn->handle == 0)
+		kfree(conn);
+
 	return 0;
 }