Commit 13a9c4ac authored by Leon Romanovsky's avatar Leon Romanovsky Committed by David S. Miller

net/prestera: Fix devlink groups leakage in error flow

Devlink trap group is registered but not released in error flow,
add the missing devlink_trap_groups_unregister() call.

Fixes: 0a9003f4 ("net: marvell: prestera: devlink: add traps/groups implementation")
Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 06f5553e
......@@ -530,6 +530,8 @@ static int prestera_devlink_traps_register(struct prestera_switch *sw)
prestera_trap = &prestera_trap_items_arr[i];
devlink_traps_unregister(devlink, &prestera_trap->trap, 1);
}
devlink_trap_groups_unregister(devlink, prestera_trap_groups_arr,
groups_count);
err_groups_register:
kfree(trap_data->trap_items_arr);
err_trap_items_alloc:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment