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:32:04 +0000 (14:32 +0200)
commit889c56ea941ed327e037db04b7630f1c85d777df
tree70de3468d5c96472fc3e4f2fca49738171a3d4ed
parent558454ec5170731fd3ab18837625073d08a0386b
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