mirror of
https://github.com/torvalds/linux.git
synced 2026-09-11 20:13:02 +02:00
drm/virtio: Fix a NULL vs ERR_PTR() bug in virtio_gpu_user_framebuffer_create()
Smatch complains that returning a NULL here will lead to a NULL pointer
dereference in drm_mode_addfb2(). Return an error pointer instead.
Fixes: dc5698e80c ("Add virtio gpu driver.")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patch.msgid.link/an1tWfHIHwtXd9SO@stanley.mountain
This commit is contained in:
parent
f4f2bba28d
commit
94579f24e2
|
|
@ -344,7 +344,7 @@ virtio_gpu_user_framebuffer_create(struct drm_device *dev,
|
|||
if (ret) {
|
||||
kfree(virtio_gpu_fb);
|
||||
drm_gem_object_put(obj);
|
||||
return NULL;
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
return &virtio_gpu_fb->base;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user