mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-18 08:56:23 +07:00
virtio-gpu: avoid possible NULL pointer dereference
If output is NULL it is not permissable to dereference it. So we should leave the respective function in this case. The inconsistency was indicated by cppcheck. No actual NULL pointer dereference was observed. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Message-id: 1471813566-5324-1-git-send-email-xypron.glpk@gmx.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
4532b241a4
commit
b28c69dd3d
@ -76,7 +76,8 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane,
|
||||
output = drm_crtc_to_virtio_gpu_output(plane->state->crtc);
|
||||
if (old_state->crtc)
|
||||
output = drm_crtc_to_virtio_gpu_output(old_state->crtc);
|
||||
WARN_ON(!output);
|
||||
if (WARN_ON(!output))
|
||||
return;
|
||||
|
||||
if (plane->state->fb) {
|
||||
vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
|
||||
@ -129,7 +130,8 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
|
||||
output = drm_crtc_to_virtio_gpu_output(plane->state->crtc);
|
||||
if (old_state->crtc)
|
||||
output = drm_crtc_to_virtio_gpu_output(old_state->crtc);
|
||||
WARN_ON(!output);
|
||||
if (WARN_ON(!output))
|
||||
return;
|
||||
|
||||
if (plane->state->fb) {
|
||||
vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
|
||||
|
Loading…
Reference in New Issue
Block a user