mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 13:06:59 +02:00
drm/fb_dma: Add checks in drm_fb_dma_get_scanout_buffer()
plane->state and plane->state->fb can be NULL, so add a check before
dereferencing them.
Found by testing with the imx driver.
Fixes: 879b3b6511 ("drm/fb_dma: Add generic get_scanout_buffer() for drm_panic")
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240426121121.241366-1-jfalempe@redhat.com
This commit is contained in:
parent
4a9a567ab1
commit
986c12d8c9
|
|
@ -167,6 +167,9 @@ int drm_fb_dma_get_scanout_buffer(struct drm_plane *plane,
|
|||
struct drm_gem_dma_object *dma_obj;
|
||||
struct drm_framebuffer *fb;
|
||||
|
||||
if (!plane->state || !plane->state->fb)
|
||||
return -EINVAL;
|
||||
|
||||
fb = plane->state->fb;
|
||||
/* Only support linear modifier */
|
||||
if (fb->modifier != DRM_FORMAT_MOD_LINEAR)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user