Skip to contentSkip to conversation

drm: check if alloc_workqueue fails

PATCH New Kangjie Lu 1 participant 1 message Mar 9, 2019

Subsystems (2)
lore
Share & tools
lore

Kangjie Lu

author
#0 lore raw

PATCH 1/1 drm: check if alloc_workqueue fails

alloc_workqueue may fail. The fix checks its status. We probably need to add a return value for radeon_crtc_init, so that we can pass an error code upstream.

---
 drivers/gpu/drm/radeon/radeon_display.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/radeon/radeon_display.c +2 -0
index aa898c699101..16f95bde8c2e 100644
@@ -678,6 +678,8 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
 	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);
+	if (!radeon_crtc->flip_queue)
+		DRM_ERROR("failed to allocate the flip queue\n");
 	rdev->mode_info.crtcs[index] = radeon_crtc;
 
 	if (rdev->family >= CHIP_BONAIRE) {
Signature · 1 line
2.17.1