Commit 687f084a authored by Rob Clark's avatar Rob Clark

drm/msm: grab struct_mutex after allocating submit

No real need to hold the lock over allocation, and simplifies things
slightly if we change the order.
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent c01a958e
...@@ -339,13 +339,11 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, ...@@ -339,13 +339,11 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
if (args->nr_cmds > MAX_CMDS) if (args->nr_cmds > MAX_CMDS)
return -EINVAL; return -EINVAL;
mutex_lock(&dev->struct_mutex);
submit = submit_create(dev, gpu, args->nr_bos); submit = submit_create(dev, gpu, args->nr_bos);
if (!submit) { if (!submit)
ret = -ENOMEM; return -ENOMEM;
goto out;
} mutex_lock(&dev->struct_mutex);
ret = submit_lookup_objects(submit, args, file); ret = submit_lookup_objects(submit, args, file);
if (ret) if (ret)
...@@ -420,7 +418,6 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, ...@@ -420,7 +418,6 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
args->fence = submit->fence; args->fence = submit->fence;
out: out:
if (submit)
submit_cleanup(submit, !!ret); submit_cleanup(submit, !!ret);
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment