summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vkms
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2019-03-09 05:36:27 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2019-03-25 09:33:42 +0100
commit208c6e8cff1b96eca401adbd544ac00133df9e90 (patch)
treedbf483bcd997ba7a356fb521d70fd867a0ffc616 /drivers/gpu/drm/vkms
parentdrm/doc: fix missing verb (diff)
downloadlinux-208c6e8cff1b96eca401adbd544ac00133df9e90.tar.xz
linux-208c6e8cff1b96eca401adbd544ac00133df9e90.zip
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: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20190309043628.6078-1-kjlu@umn.edu
Diffstat (limited to 'drivers/gpu/drm/vkms')
-rw-r--r--drivers/gpu/drm/vkms/vkms_crtc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
index 8a9aeb0a9ea8..bb66dbcd5e3f 100644
--- a/drivers/gpu/drm/vkms/vkms_crtc.c
+++ b/drivers/gpu/drm/vkms/vkms_crtc.c
@@ -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;
}