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)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Mar 2021 19:33:06 +0000 (12:33 -0700)
commit9e0a537d06fc36861e4f78d0a7df1fe2b3592714
treeeab162404d0ce05a873a66bf9dc4b5c8e0ec0069
parentf51d7bf1dbe5522c51c93fe8faa5f4abbdf339cd
octeontx2-af: Fix memory leak of object buf

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>
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c