]> git.baikalelectronics.ru Git - kernel.git/commit
net: fec: fix the potential memory leak in fec_enet_init()
authorFugang Duan <fugang.duan@nxp.com>
Wed, 12 May 2021 02:43:59 +0000 (10:43 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 May 2021 21:01:50 +0000 (14:01 -0700)
commit82f012b5ec78b0fc6d0df722d1e60ea88538fb07
tree388b92d947a8a7d161bbe727b8247d8b68e1da79
parent0eb61e918ae593b33c72b7659e3c151fcd4229f4
net: fec: fix the potential memory leak in fec_enet_init()

If the memory allocated for cbd_base is failed, it should
free the memory allocated for the queues, otherwise it causes
memory leak.

And if the memory allocated for the queues is failed, it can
return error directly.

Fixes: a14a9e5ef5bb ("net: fec: init multi queue date structure")
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c