Re: Memory leak on failed connection attempt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tomas,

* Tomas Targownik <ttargownik@xxxxxxxxx> [2011-06-24 08:34:41 +1000]:

> I have isolated the memory leak to the hci_conn struct not being freed
> on a hci_conn_del() call if the remote bluetooth device is not present.
> The patch below remedies this.
> 
> ---
> net/bluetooth/hci_conn.c |    5 +++++
> 1 file changed, 5 insertions(+)
> 
> diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
> index 7a6f56b..62510f7 100644
> --- a/net/bluetooth/hci_conn.c
> +++ b/net/bluetooth/hci_conn.c
> @@ -375,6 +375,11 @@ int hci_conn_del(struct hci_conn *conn)
> 
> hci_dev_put(hdev);
> 
> +   if (conn->handle == 0)
> +   {
> +       kfree(conn);
> +   }
> +
> return 0;

I agree with this patch, but just send me a git formatted patch with proper
coding style.

	Gustavo
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux