diff options
author | Tommi Rantala <tt.rantala@gmail.com> | 2015-04-03 03:45:29 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-04-08 00:32:01 -0400 |
commit | 04bdf441787a385487fb7b08d9a3f35a1271b474 (patch) | |
tree | 092a39a156da65a66ddfb7bf191707e8c3dfa6d2 /drivers/gpu/drm/drm_crtc.c | |
parent | f22e6e847115abc3a0e2ad7bb18d243d42275af1 (diff) |
drm: fix drm_mode_getconnector() locking imbalance regression
Regression in commit 2caa80e72b57c6216aec6f6a11fcfb4fec46daa0
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Sun Feb 22 11:38:36 2015 +0100
drm: Fix deadlock due to getconnector locking changes
If the drm_connector_find() call returns NULL, we should no longer
call drm_modeset_unlock() to avoid locking imbalance.
Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 679b10e34fb5..b6f076b213bc 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -2121,7 +2121,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, | |||
2121 | connector = drm_connector_find(dev, out_resp->connector_id); | 2121 | connector = drm_connector_find(dev, out_resp->connector_id); |
2122 | if (!connector) { | 2122 | if (!connector) { |
2123 | ret = -ENOENT; | 2123 | ret = -ENOENT; |
2124 | goto out; | 2124 | goto out_unlock; |
2125 | } | 2125 | } |
2126 | 2126 | ||
2127 | for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) | 2127 | for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) |
@@ -2201,6 +2201,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, | |||
2201 | 2201 | ||
2202 | out: | 2202 | out: |
2203 | drm_modeset_unlock(&dev->mode_config.connection_mutex); | 2203 | drm_modeset_unlock(&dev->mode_config.connection_mutex); |
2204 | |||
2205 | out_unlock: | ||
2204 | mutex_unlock(&dev->mode_config.mutex); | 2206 | mutex_unlock(&dev->mode_config.mutex); |
2205 | 2207 | ||
2206 | return ret; | 2208 | return ret; |