VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Zhengchao Shao <shaozhengchao@huawei.com> 2023-06-30 09:26:47 +0800 committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2023-07-19 16:36:44 +0200 commit: cd716022c968bc6748f23708b986f845b45791b7 parent: 82b3e8afba06362204137d1455d79732ad1f1dfc
Commit Summary:
mlxsw: minimal: fix potential memory leak in mlxsw_m_linecards_init
Diffstat:
1 file changed, 1 insertion, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c
index 6b56eadd736e..6b98c3287b49 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c
@@ -417,6 +417,7 @@ static int mlxsw_m_linecards_init(struct mlxsw_m *mlxsw_m)
 err_kmalloc_array:
 	for (i--; i >= 0; i--)
 		kfree(mlxsw_m->line_cards[i]);
+	kfree(mlxsw_m->line_cards);
 err_kcalloc:
 	kfree(mlxsw_m->ports);
 	return err;