Commit 208c6e8c authored by Kangjie Lu's avatar Kangjie Lu Committed by Daniel Vetter
Browse files

drm: vkms: check status of alloc_ordered_workqueue



alloc_ordered_workqueue may fail and return NULL.
The fix returns ENOMEM when it fails to avoid potential NULL
pointer dereference.

Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190309043628.6078-1-kjlu@umn.edu
parent 60e6ecfb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -219,6 +219,8 @@ int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
	spin_lock_init(&vkms_out->state_lock);

	vkms_out->crc_workq = alloc_ordered_workqueue("vkms_crc_workq", 0);
	if (!vkms_out->crc_workq)
		return -ENOMEM;

	return ret;
}