From: Parav Pandit Date: Tue, 21 Jul 2020 16:53:51 +0000 (+0300) Subject: devlink: Do not hold devlink mutex when initializing devlink fields X-Git-Tag: v5.10.7~1943^2~169^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6553e561cadc0ec966ce2f039965a99a7502e19b;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller --- diff --git a/net/core/devlink.c b/net/core/devlink.c index 6335e18..7df918a 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);