aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2011-11-03 16:03:05 -0400
committerDave Airlie <airlied@redhat.com>2011-11-07 08:15:56 -0500
commit55bde5b215ceb8356328f18cd82a77843bc4ffd3 (patch)
tree4d9f311c7d3dc9befb69a1b6cbd6ee9fd996b635 /drivers
parentd982640914d74054d22508ccebeeda70ce5933e1 (diff)
vmwgfx: Free prefered mode on error path
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_kms.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index 41a905d6c4f..667437b037f 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -1710,17 +1710,22 @@ int vmw_du_connector_fill_modes(struct drm_connector *connector,
1710 mode->hdisplay = du->pref_width; 1710 mode->hdisplay = du->pref_width;
1711 mode->vdisplay = du->pref_height; 1711 mode->vdisplay = du->pref_height;
1712 vmw_guess_mode_timing(mode); 1712 vmw_guess_mode_timing(mode);
1713
1713 if (vmw_kms_validate_mode_vram(dev_priv, mode->hdisplay * 2, 1714 if (vmw_kms_validate_mode_vram(dev_priv, mode->hdisplay * 2,
1714 mode->vdisplay)) { 1715 mode->vdisplay)) {
1715 drm_mode_probed_add(connector, mode); 1716 drm_mode_probed_add(connector, mode);
1717 } else {
1718 drm_mode_destroy(dev, mode);
1719 mode = NULL;
1720 }
1716 1721
1717 if (du->pref_mode) { 1722 if (du->pref_mode) {
1718 list_del_init(&du->pref_mode->head); 1723 list_del_init(&du->pref_mode->head);
1719 drm_mode_destroy(dev, du->pref_mode); 1724 drm_mode_destroy(dev, du->pref_mode);
1720 }
1721
1722 du->pref_mode = mode;
1723 } 1725 }
1726
1727 /* mode might be null here, this is intended */
1728 du->pref_mode = mode;
1724 } 1729 }
1725 1730
1726 for (i = 0; vmw_kms_connector_builtin[i].type != 0; i++) { 1731 for (i = 0; vmw_kms_connector_builtin[i].type != 0; i++) {