Re: [PATCH v3] bluetooth: hci_h5: fix memory leak in h5_close

2020-10-06 Thread Hans de Goede
Hi, On 10/6/20 4:44 AM, Anant Thazhemadam wrote: On 05-10-2020 14:48, Hans de Goede wrote: To fully fix the memleak you also need to add a kfree_skb(h5->rx_skb); call to the end of h5_serdev_remove(), because in the hu->serdev case that is where the h5 struct will be free-ed (it is free-ed

Re: [PATCH v3] bluetooth: hci_h5: fix memory leak in h5_close

2020-10-05 Thread Anant Thazhemadam
On 05-10-2020 14:48, Hans de Goede wrote: > To fully fix the memleak you also need to add a kfree_skb(h5->rx_skb); > call to the end of h5_serdev_remove(), because in the hu->serdev case > that is where the h5 struct will be free-ed (it is free-ed after that > function exits). Hi Hans, I'm not

Re: [PATCH v3] bluetooth: hci_h5: fix memory leak in h5_close

2020-10-05 Thread Hans de Goede
Hi, On 10/4/20 7:17 AM, Anant Thazhemadam wrote: When h5_close() is called and !hu->serdev, h5 is directly freed. However, h5->rx_skb is not freed before h5 is freed, which causes a memory leak. Freeing h5->rx_skb (when !hu->serdev) fixes this memory leak before freeing h5. Fixes: ce945552fde4

[PATCH v3] bluetooth: hci_h5: fix memory leak in h5_close

2020-10-03 Thread Anant Thazhemadam
When h5_close() is called and !hu->serdev, h5 is directly freed. However, h5->rx_skb is not freed before h5 is freed, which causes a memory leak. Freeing h5->rx_skb (when !hu->serdev) fixes this memory leak before freeing h5. Fixes: ce945552fde4 ("Bluetooth: hci_h5: Add support for serdev