]> git.baikalelectronics.ru Git - kernel.git/commit
octeontx2-af: fix memory leak of lmac and lmac->name
authorColin Ian King <colin.king@canonical.com>
Thu, 7 Jan 2021 12:39:16 +0000 (12:39 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 8 Jan 2021 02:39:04 +0000 (18:39 -0800)
commit3690c6191c7c1978797a2e0f2266c7abc4616d11
tree70699701825d4b3c51ce7ed908147c5c01c408af
parent1b84b8f8d1e1146d8e119a309f5ba2abc3979ebe
octeontx2-af: fix memory leak of lmac and lmac->name

Currently the error return paths don't kfree lmac and lmac->name
leading to some memory leaks.  Fix this by adding two error return
paths that kfree these objects

Addresses-Coverity: ("Resource leak")
Fixes: 40e7a91e7e51 ("octeontx2-af: Add support for CGX link management")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210107123916.189748-1-colin.king@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/cgx.c