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
This commit is contained in:
Родитель
60e6ecfb61
Коммит
208c6e8cff
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче