mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-14 06:35:12 +00:00
drm/vkms: fix variable dereferenced before check warning
Smatch warns:
drivers/gpu/drm/vkms/vkms_plane.c:110 vkms_plane_atomic_update() warn:
variable dereferenced before check 'fb' (see line 108)
Fix the warning by moving the dereference after the NULL check.
Fixes: 8ba1648567
("drm: vkms: Refactor the plane composer to accept new formats")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220908105623.72777-1-harshit.m.mogalapalli@oracle.com
This commit is contained in:
parent
fa47573b04
commit
aaa6552028
1 changed files with 2 additions and 1 deletions
|
@ -105,11 +105,12 @@ static void vkms_plane_atomic_update(struct drm_plane *plane,
|
|||
struct drm_shadow_plane_state *shadow_plane_state;
|
||||
struct drm_framebuffer *fb = new_state->fb;
|
||||
struct vkms_frame_info *frame_info;
|
||||
u32 fmt = fb->format->format;
|
||||
u32 fmt;
|
||||
|
||||
if (!new_state->crtc || !fb)
|
||||
return;
|
||||
|
||||
fmt = fb->format->format;
|
||||
vkms_plane_state = to_vkms_plane_state(new_state);
|
||||
shadow_plane_state = &vkms_plane_state->base;
|
||||
|
||||
|
|
Loading…
Reference in a new issue