summaryrefslogtreecommitdiffstats
path: root/drivers/net/netdevsim/devlink.c
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2018-07-26 00:39:27 +0200
committerDavid S. Miller <davem@davemloft.net>2018-07-26 07:33:39 +0200
commitc259b4fb33ee6e7667bf1d34bf0803b7c5fdbdce (patch)
tree7ff41667fe1f0d2ab0af572b4e6b28b4000ee644 /drivers/net/netdevsim/devlink.c
parentnet: igmp: make function __ip_mc_inc_group() static (diff)
downloadlinux-c259b4fb33ee6e7667bf1d34bf0803b7c5fdbdce.tar.xz
linux-c259b4fb33ee6e7667bf1d34bf0803b7c5fdbdce.zip
netdevsim: don't leak devlink resources
Devlink resources registered with devlink_resource_register() have to be unregistered. Fixes: 37923ed6b8ce ("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>
Diffstat (limited to 'drivers/net/netdevsim/devlink.c')
-rw-r--r--drivers/net/netdevsim/devlink.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/netdevsim/devlink.c b/drivers/net/netdevsim/devlink.c
index ba663e5af168..5135fc371f01 100644
--- a/drivers/net/netdevsim/devlink.c
+++ b/drivers/net/netdevsim/devlink.c
@@ -207,6 +207,7 @@ void nsim_devlink_teardown(struct netdevsim *ns)
struct net *net = nsim_to_net(ns);
bool *reg_devlink = net_generic(net, nsim_devlink_id);
+ devlink_resources_unregister(ns->devlink, NULL);
devlink_unregister(ns->devlink);
devlink_free(ns->devlink);
ns->devlink = NULL;