提交 fd6040ed 编写于 作者: R Russell King 提交者: Greg Kroah-Hartman

imx-drm: imx-drm-core: improve safety of imx_drm_add_crtc()

We must not add more CRTCs than we have declared to the vblank
helpers, otherwise we overflow their arrays.  Force failure if we
exceed the number of CRTCs.
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
Acked-by: NSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9fe73d46
...@@ -501,6 +501,15 @@ int imx_drm_add_crtc(struct drm_crtc *crtc, ...@@ -501,6 +501,15 @@ int imx_drm_add_crtc(struct drm_crtc *crtc,
mutex_lock(&imxdrm->mutex); mutex_lock(&imxdrm->mutex);
/*
* The vblank arrays are dimensioned by MAX_CRTC - we can't
* pass IDs greater than this to those functions.
*/
if (imxdrm->pipes >= MAX_CRTC) {
ret = -EINVAL;
goto err_busy;
}
if (imxdrm->drm->open_count) { if (imxdrm->drm->open_count) {
ret = -EBUSY; ret = -EBUSY;
goto err_busy; goto err_busy;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册