summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/drm_crtc.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 2e6103c..cba8c8b 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -2542,19 +2542,14 @@ int drm_mode_getfb(struct drm_device *dev,
{
struct drm_mode_fb_cmd *r = data;
struct drm_framebuffer *fb;
- int ret = 0;
+ int ret;
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- drm_modeset_lock_all(dev);
fb = drm_framebuffer_lookup(dev, r->fb_id);
- if (!fb) {
- ret = -EINVAL;
- goto out;
- }
- /* fb is protect by the mode_config lock, so drop the ref immediately */
- drm_framebuffer_unreference(fb);
+ if (!fb)
+ return -EINVAL;
r->height = fb->height;
r->width = fb->width;
@@ -2566,8 +2561,8 @@ int drm_mode_getfb(struct drm_device *dev,
else
ret = -ENODEV;
-out:
- drm_modeset_unlock_all(dev);
+ drm_framebuffer_unreference(fb);
+
return ret;
}
OpenPOWER on IntegriCloud