mbox series

[net,0/3] net: ethernet: mtk_eth_wed: fixe some leaks

Message ID 20221017035156.2497448-1-yangyingliang@huawei.com (mailing list archive)
Headers show
Series net: ethernet: mtk_eth_wed: fixe some leaks | expand

Message

Yang Yingliang Oct. 17, 2022, 3:51 a.m. UTC
I found some leaks in mtk_eth_soc.c/mtk_wed.c.

 patch#1 - I found mtk_wed_exit() is never called, I think mtk_wed_exit() need
           be called in error path or module remove function to free the memory
           allocated in mtk_wed_add_hw().

 patch#2 - The device is not put in error path in mtk_wed_add_hw().

 patch#3 - The device_node pointer returned by of_parse_phandle() with refcount
           incremented, it should be decreased when it done.

This patchset was just compiled tested because I don't have any HW on which to do
the actual tests.

Yang Yingliang (3):
  net: ethernet: mtk_eth_soc: fix possible memory leak in mtk_probe()
  net: ethernet: mtk_eth_wed: add missing put_device() in
    mtk_wed_add_hw()
  net: ethernet: mtk_eth_wed: add missing of_node_put()

 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 17 ++++++++++++-----
 drivers/net/ethernet/mediatek/mtk_wed.c     | 15 ++++++++++++---
 2 files changed, 24 insertions(+), 8 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 17, 2022, 8:40 a.m. UTC | #1
Hello:

This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Mon, 17 Oct 2022 11:51:53 +0800 you wrote:
> I found some leaks in mtk_eth_soc.c/mtk_wed.c.
> 
>  patch#1 - I found mtk_wed_exit() is never called, I think mtk_wed_exit() need
>            be called in error path or module remove function to free the memory
>            allocated in mtk_wed_add_hw().
> 
>  patch#2 - The device is not put in error path in mtk_wed_add_hw().
> 
> [...]

Here is the summary with links:
  - [net,1/3] net: ethernet: mtk_eth_soc: fix possible memory leak in mtk_probe()
    https://git.kernel.org/netdev/net/c/b3d0d98179d6
  - [net,2/3] net: ethernet: mtk_eth_wed: add missing put_device() in mtk_wed_add_hw()
    https://git.kernel.org/netdev/net/c/9d4f20a476ca
  - [net,3/3] net: ethernet: mtk_eth_wed: add missing of_node_put()
    https://git.kernel.org/netdev/net/c/e0bb4659e235

You are awesome, thank you!