Commit c259b4fb authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

netdevsim: don't leak devlink resources

Devlink resources registered with devlink_resource_register() have
to be unregistered.

Fixes: 37923ed6 ("netdevsim: Add simple FIB resource controller via devlink")
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarQuentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b87bac10
...@@ -207,6 +207,7 @@ void nsim_devlink_teardown(struct netdevsim *ns) ...@@ -207,6 +207,7 @@ void nsim_devlink_teardown(struct netdevsim *ns)
struct net *net = nsim_to_net(ns); struct net *net = nsim_to_net(ns);
bool *reg_devlink = net_generic(net, nsim_devlink_id); bool *reg_devlink = net_generic(net, nsim_devlink_id);
devlink_resources_unregister(ns->devlink, NULL);
devlink_unregister(ns->devlink); devlink_unregister(ns->devlink);
devlink_free(ns->devlink); devlink_free(ns->devlink);
ns->devlink = NULL; ns->devlink = NULL;
......
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