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)
committerJakub Kicinski <kuba@kernel.org>
Fri, 21 Oct 2022 04:09:47 +0000 (21:09 -0700)
commit4c1f602df8956bc0decdafd7e4fc7eef50c550b1
tree82f8689f5d0f5afd6f80503693bf9c509979ad8d
parentc0605cd6750f2db9890c43a91ea4d77be8fb4908
net: hinic: fix memory leak when reading function table

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>
drivers/net/ethernet/huawei/hinic/hinic_debugfs.c