diff options
author | Dave Airlie <airlied@linux.ie> | 2007-04-12 11:28:55 +1000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2007-04-12 11:28:55 +1000 |
commit | a5cf4cc369fcc2cf7b84bbaef1e458250ecb91ee (patch) | |
tree | 0782dce412a26ec594cf413132920f0101ba3d74 | |
parent | 981f8156de0c5ec6387f659fbcac031d663d943c (diff) |
fix unbalanced lock and make sure mode list has modes so lvds code doesn't crash
-rw-r--r-- | linux-core/drm_crtc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/linux-core/drm_crtc.c b/linux-core/drm_crtc.c index 21d7012e..63ad829d 100644 --- a/linux-core/drm_crtc.c +++ b/linux-core/drm_crtc.c @@ -37,6 +37,7 @@ struct drm_framebuffer *drm_framebuffer_create(drm_device_t *dev) spin_lock(&dev->mode_config.config_lock); /* Limit to single framebuffer for now */ if (dev->mode_config.num_fb > 1) { + spin_unlock(&dev->mode_config.config_lock); DRM_ERROR("Attempt to add multiple framebuffers failed\n"); return NULL; } @@ -542,6 +543,9 @@ bool drm_initial_config(drm_device_t *dev, struct drm_framebuffer *fb, list_for_each_entry(output, &dev->mode_config.output_list, head) { struct drm_display_mode *des_mode; + if (list_empty(&output->modes)) + continue; + /* Get the first preferred moded */ list_for_each_entry(des_mode, &output->modes, head) { if (des_mode->flags & DRM_MODE_TYPE_PREFERRED) |