From: Tomas Targownik Date: Thu, 30 Jun 2011 19:30:44 +0000 (-0300) Subject: Bluetooth: Fix memory leak under page timeouts X-Git-Tag: firefly_0821_release~7613^2~418 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1be668d732e91d7a83529b0e2946c0343c1df6be;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Gustavo F. Padovan --- diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index b7ff6e3ee25c..5ec0db423169 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -453,6 +453,9 @@ int hci_conn_del(struct hci_conn *conn) hci_dev_put(hdev); + if (conn->handle == 0) + kfree(conn); + return 0; }