net: hinic: fix memory leak when reading function table
authorZhengchao Shao <shaozhengchao@huawei.com>
Wed, 19 Oct 2022 09:57:52 +0000 (17:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 14:59:15 +0000 (23:59 +0900)
commite6765fe8de372a84f8dbe9e03ec13c7c70f946b8
tree103c9819786e6481e929b1f981a74ea1aafa75c5
parent62aa78a0c3e5c0257daf52fa6e54470acdb3f2c5
net: hinic: fix memory leak when reading function table

[ Upstream commit 4c1f602df8956bc0decdafd7e4fc7eef50c550b1 ]

When the input parameter idx meets the expected case option in
hinic_dbg_get_func_table(), read_data is not released. Fix it.

Fixes: 5215e16244ee ("hinic: add support to query function table")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/huawei/hinic/hinic_debugfs.c