diff options
Diffstat (limited to 'net/devlink')
-rw-r--r-- | net/devlink/core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/devlink/core.c b/net/devlink/core.c index bcbbb952569f..c47c9e6c744f 100644 --- a/net/devlink/core.c +++ b/net/devlink/core.c @@ -310,6 +310,7 @@ static void devlink_release(struct work_struct *work) mutex_destroy(&devlink->lock); lockdep_unregister_key(&devlink->lock_key); + put_device(devlink->dev); kfree(devlink); } @@ -425,7 +426,7 @@ struct devlink *devlink_alloc_ns(const struct devlink_ops *ops, if (ret < 0) goto err_xa_alloc; - devlink->dev = dev; + devlink->dev = get_device(dev); devlink->ops = ops; xa_init_flags(&devlink->ports, XA_FLAGS_ALLOC); xa_init_flags(&devlink->params, XA_FLAGS_ALLOC); |