]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
octeontx2-af: Fix memory leak of object buf
authorColin Ian King <colin.king@canonical.com>
Tue, 23 Mar 2021 12:32:45 +0000 (12:32 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:30:26 +0000 (14:30 +0200)
commitcbf813a232cddd691d5af86a95446db976a5a10e
tree8ae0089e5434452276da47af85668bb652bee97e
parent458ce1e66cee7a9e9f6eb4066ad7616cd86ae8a0
octeontx2-af: Fix memory leak of object buf

[ Upstream commit 9e0a537d06fc36861e4f78d0a7df1fe2b3592714 ]

Currently the error return path when lfs fails to allocate is not free'ing
the memory allocated to buf. Fix this by adding the missing kfree.

Addresses-Coverity: ("Resource leak")
Fixes: f7884097141b ("octeontx2-af: Formatting debugfs entry rsrc_alloc.")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c