Skip to content

Commit 3a99cbb

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum_dpipe: Add missing error path
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: 2ba5999 ("mlxsw: spectrum: Add Support for erif table entries access") Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 36844c8 commit 3a99cbb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ mlxsw_sp_dpipe_table_erif_entries_dump(void *priv, bool counters_enabled,
215215
start_again:
216216
err = devlink_dpipe_entry_ctx_prepare(dump_ctx);
217217
if (err)
218-
return err;
218+
goto err_ctx_prepare;
219219
j = 0;
220220
for (; i < rif_count; i++) {
221221
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,
247247
return 0;
248248
err_entry_append:
249249
err_entry_get:
250+
err_ctx_prepare:
250251
rtnl_unlock();
251252
devlink_dpipe_entry_clear(&entry);
252253
return err;

0 commit comments

Comments
 (0)