提交 92b300c4 编写于 作者: C Chen-Yu Tsai 提交者: Maxime Ripard

drm/sun4i: Check return value of drm_vblank_init

drm_vblank_init can fail due to insufficient memory. Ignoring the error
and proceeding may cause the kernel to dereference an invalid pointer
when vblank is enabled.
Signed-off-by: NChen-Yu Tsai <wens@csie.org>
Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
上级 9d56defb
......@@ -102,7 +102,11 @@ static int sun4i_drv_bind(struct device *dev)
}
drm->dev_private = drv;
drm_vblank_init(drm, 1);
/* drm_vblank_init calls kcalloc, which can fail */
ret = drm_vblank_init(drm, 1);
if (ret)
goto free_drm;
drm_mode_config_init(drm);
ret = component_bind_all(drm->dev, drm);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册