Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22fa9aa0 authored by Ido Schimmel's avatar Ido Schimmel Committed by Greg Kroah-Hartman
Browse files

mlxsw: spectrum_dpipe: Add missing error path



[ Upstream commit 3a99cbb6fa7bca1995586ec2dc21b0368aad4937 ]

In case devlink_dpipe_entry_ctx_prepare() failed, release RTNL that was
previously taken and free the memory allocated by
mlxsw_sp_erif_entry_prepare().

Fixes: 2ba5999f ("mlxsw: spectrum: Add Support for erif table entries access")
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 55c549ea
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ mlxsw_sp_dpipe_table_erif_entries_dump(void *priv, bool counters_enabled,
start_again:
	err = devlink_dpipe_entry_ctx_prepare(dump_ctx);
	if (err)
		return err;
		goto err_ctx_prepare;
	j = 0;
	for (; i < rif_count; i++) {
		struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i);
@@ -247,6 +247,7 @@ mlxsw_sp_dpipe_table_erif_entries_dump(void *priv, bool counters_enabled,
	return 0;
err_entry_append:
err_entry_get:
err_ctx_prepare:
	rtnl_unlock();
	devlink_dpipe_entry_clear(&entry);
	return err;