diff mbox

[24/37] drm: Check for malloc failure from drm_cvt_create().

Message ID 1268261124-13653-25-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State Not Applicable
Headers show

Commit Message

Chris Wilson March 10, 2010, 10:45 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index f24f5ee..0dd3ce4 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -331,6 +331,9 @@  create_mode:
 			    cmdline_mode->refresh_specified ? cmdline_mode->refresh : 60,
 			    cmdline_mode->rb, cmdline_mode->interlace,
 			    cmdline_mode->margins);
+	if (mode == NULL)
+		return NULL;
+
 	drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
 	list_add(&mode->head, &connector->modes);
 	return mode;