From: Martin H. <hu...@gm...> - 2009-05-26 17:29:30
|
The problem is the drm_mode_setcrtc function does not check whether allocation of new display mode succeeded or not. Signed-off-by: Martin Hurton <hu...@gm...> --- drivers/gpu/drm/drm_crtc.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 94a7688..1a3d6b6 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1451,6 +1451,11 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, } mode = drm_mode_create(dev); + if (!mode) { + ret = -ENOMEM; + goto out; + } + drm_crtc_convert_umode(mode, &crtc_req->mode); drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); } -- 1.6.2.4 |