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)
commitac7996d680d8b4a51bb99bbdcee3dc838b985498
tree70699701825d4b3c51ce7ed908147c5c01c408af
parent85bd6055e3529e9b193b4460f5b13a47da354027
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: 1463f382f58d ("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