From 7250779598e40508c9dd3cf60659141890274bcd Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 29 Jan 2024 01:34:47 +0000 Subject: [PATCH] drm/radeon: check the alloc_workqueue return value in radeon_crtc_init() From Yang Yingliang 0b813a6a0087451cb702b6eb841f10856f49d088 in linux-6.6.y/6.6.14 7a2464fac80d42f6f8819fed97a553e9c2f43310 in mainline linux --- sys/dev/pci/drm/radeon/radeon_display.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/radeon/radeon_display.c b/sys/dev/pci/drm/radeon/radeon_display.c index e475602af0b..94132c37d0b 100644 --- a/sys/dev/pci/drm/radeon/radeon_display.c +++ b/sys/dev/pci/drm/radeon/radeon_display.c @@ -687,11 +687,16 @@ static void radeon_crtc_init(struct drm_device *dev, int index) if (radeon_crtc == NULL) 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_mode_crtc_set_gamma_size(&radeon_crtc->base, 256); radeon_crtc->crtc_id = index; - radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0); rdev->mode_info.crtcs[index] = radeon_crtc; if (rdev->family >= CHIP_BONAIRE) { -- 2.20.1