netdevsim: don't leak devlink resources
Devlink resources registered with devlink_resource_register() have
to be unregistered.
Fixes: 37923ed6b8
("netdevsim: Add simple FIB resource controller via devlink")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b87bac1012
commit
c259b4fb33
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue