Bluetooth: Fix memory leak under page timeouts
authorTomas Targownik <ttargownik@geicp.com>
Thu, 30 Jun 2011 19:30:44 +0000 (16:30 -0300)
committerJaikumar Ganesh <jaikumar@google.com>
Mon, 18 Jul 2011 19:28:02 +0000 (12:28 -0700)
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>
net/bluetooth/hci_conn.c

index b7ff6e3ee25c5c6b103099d8f9871dac195287d3..5ec0db423169e0598a929dc7d6396b1a380d084c 100644 (file)
@@ -453,6 +453,9 @@ int hci_conn_del(struct hci_conn *conn)
 
        hci_dev_put(hdev);
 
+       if (conn->handle == 0)
+               kfree(conn);
+
        return 0;
 }