On Tue, 14 Nov 2017 17:18:44 +0100, Jiri Pirko wrote: > +static int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info) > +{ > + struct devlink *devlink = info->user_ptr[0]; > + int err; > + > + if (!devlink->ops->reload) > + return -EOPNOTSUPP; > + > + err = devlink_resources_validate(devlink, NULL, info); > + if (err) > + return err; > + > + mutex_unlock(&devlink->lock); > + err = devlink->ops->reload(devlink); > + mutex_lock(&devlink->lock); > + > + return err; > +}
I'm a bit confused with the locking, why is devlink->lock not held around the validation?