Commit cebbb5c4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Hans de Goede

drm/vboxvideo: fix a NULL vs IS_ERR() check

The devm_gen_pool_create() function never returns NULL, it returns
error pointers.

Fixes: 4cc9b565 ("drm/vboxvideo: Use devm_gen_pool_create")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211118111233.GA1147@kili
parent bc30c3b0
......@@ -127,8 +127,8 @@ int vbox_hw_init(struct vbox_private *vbox)
/* Create guest-heap mem-pool use 2^4 = 16 byte chunks */
vbox->guest_pool = devm_gen_pool_create(vbox->ddev.dev, 4, -1,
"vboxvideo-accel");
if (!vbox->guest_pool)
return -ENOMEM;
if (IS_ERR(vbox->guest_pool))
return PTR_ERR(vbox->guest_pool);
ret = gen_pool_add_virt(vbox->guest_pool,
(unsigned long)vbox->guest_heap,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment