diff options
author | Parav Pandit <parav@mellanox.com> | 2020-07-21 18:53:51 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-22 01:14:58 +0200 |
commit | 6553e561cadc0ec966ce2f039965a99a7502e19b (patch) | |
tree | 035da45deec854f94e1d70b6440718388d776630 /net/core/devlink.c | |
parent | r8169: allow to enable ASPM on RTL8125A (diff) | |
download | linux-6553e561cadc0ec966ce2f039965a99a7502e19b.tar.xz linux-6553e561cadc0ec966ce2f039965a99a7502e19b.zip |
devlink: Do not hold devlink mutex when initializing devlink fields
There is no need to hold a device global lock when initializing
devlink device fields of a devlink instance which is not yet part of the
devices list.
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/devlink.c')
-rw-r--r-- | net/core/devlink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c index 6335e1851088..7df918a5899e 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -7421,9 +7421,9 @@ EXPORT_SYMBOL_GPL(devlink_alloc); */ int devlink_register(struct devlink *devlink, struct device *dev) { - mutex_lock(&devlink_mutex); devlink->dev = dev; devlink->registered = true; + mutex_lock(&devlink_mutex); list_add_tail(&devlink->list, &devlink_list); devlink_notify(devlink, DEVLINK_CMD_NEW); mutex_unlock(&devlink_mutex); |