diff options
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_connector.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_connector.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c index a0d7b1d905e8..5cde26ac937b 100644 --- a/drivers/gpu/drm/omapdrm/omap_connector.c +++ b/drivers/gpu/drm/omapdrm/omap_connector.c | |||
@@ -121,6 +121,9 @@ static int omap_connector_get_modes(struct drm_connector *connector) | |||
121 | if (dssdrv->read_edid) { | 121 | if (dssdrv->read_edid) { |
122 | void *edid = kzalloc(MAX_EDID, GFP_KERNEL); | 122 | void *edid = kzalloc(MAX_EDID, GFP_KERNEL); |
123 | 123 | ||
124 | if (!edid) | ||
125 | return 0; | ||
126 | |||
124 | if ((dssdrv->read_edid(dssdev, edid, MAX_EDID) > 0) && | 127 | if ((dssdrv->read_edid(dssdev, edid, MAX_EDID) > 0) && |
125 | drm_edid_is_valid(edid)) { | 128 | drm_edid_is_valid(edid)) { |
126 | drm_mode_connector_update_edid_property( | 129 | drm_mode_connector_update_edid_property( |
@@ -139,6 +142,9 @@ static int omap_connector_get_modes(struct drm_connector *connector) | |||
139 | struct drm_display_mode *mode = drm_mode_create(dev); | 142 | struct drm_display_mode *mode = drm_mode_create(dev); |
140 | struct videomode vm = {0}; | 143 | struct videomode vm = {0}; |
141 | 144 | ||
145 | if (!mode) | ||
146 | return 0; | ||
147 | |||
142 | dssdrv->get_timings(dssdev, &vm); | 148 | dssdrv->get_timings(dssdev, &vm); |
143 | 149 | ||
144 | drm_display_mode_from_videomode(&vm, mode); | 150 | drm_display_mode_from_videomode(&vm, mode); |
@@ -200,6 +206,10 @@ static int omap_connector_mode_valid(struct drm_connector *connector, | |||
200 | if (!r) { | 206 | if (!r) { |
201 | /* check if vrefresh is still valid */ | 207 | /* check if vrefresh is still valid */ |
202 | new_mode = drm_mode_duplicate(dev, mode); | 208 | new_mode = drm_mode_duplicate(dev, mode); |
209 | |||
210 | if (!new_mode) | ||
211 | return MODE_BAD; | ||
212 | |||
203 | new_mode->clock = vm.pixelclock / 1000; | 213 | new_mode->clock = vm.pixelclock / 1000; |
204 | new_mode->vrefresh = 0; | 214 | new_mode->vrefresh = 0; |
205 | if (mode->vrefresh == drm_mode_vrefresh(new_mode)) | 215 | if (mode->vrefresh == drm_mode_vrefresh(new_mode)) |