drm/radeon: check the alloc_workqueue return value in radeon_crtc_init()
[ Upstream commit 7a2464fac80d42f6f8819fed97a553e9c2f43310 ]
check the alloc_workqueue return value in radeon_crtc_init()
to avoid null-ptr-deref.
Fixes: fa7f517cb2
("drm/radeon: rework page flip handling v4")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
c20a6aa0a3
commit
57ca798480
@@ -689,11 +689,16 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
|
|||||||
if (radeon_crtc == NULL)
|
if (radeon_crtc == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0);
|
||||||
|
if (!radeon_crtc->flip_queue) {
|
||||||
|
kfree(radeon_crtc);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
drm_crtc_init(dev, &radeon_crtc->base, &radeon_crtc_funcs);
|
drm_crtc_init(dev, &radeon_crtc->base, &radeon_crtc_funcs);
|
||||||
|
|
||||||
drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256);
|
drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256);
|
||||||
radeon_crtc->crtc_id = index;
|
radeon_crtc->crtc_id = index;
|
||||||
radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0);
|
|
||||||
rdev->mode_info.crtcs[index] = radeon_crtc;
|
rdev->mode_info.crtcs[index] = radeon_crtc;
|
||||||
|
|
||||||
if (rdev->family >= CHIP_BONAIRE) {
|
if (rdev->family >= CHIP_BONAIRE) {
|
||||||
|
Reference in New Issue
Block a user