Skip to content
Commit aad9729e authored by Dmitry Osipenko's avatar Dmitry Osipenko
Browse files

drm/virtio: Fix handling CONFIG_DRM_VIRTIO_GPU_KMS option



VirtIO-GPU got a new config option for disabling KMS. There were two
problems left unnoticed during review when the new option was added:

1. The IS_ENABLED(CONFIG_DRM_VIRTIO_GPU_KMS) check in the code was
inverted, hence KMS was disabled when it should be enabled and vice versa.

2. The disabled KMS crashed kernel with a NULL dereference in
drm_kms_helper_hotplug_event(), which shall not be invoked with a
disabled KMS.

Fix the inverted config option check in the code and skip handling the
VIRTIO_GPU_EVENT_DISPLAY sent by host when KMS is disabled in guest to fix
the crash.

Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
Fixes: 72122c69

 ("drm/virtio: Add option to disable KMS support")
Signed-off-by: default avatarDmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230306163916.1595961-1-dmitry.osipenko@collabora.com
parent bf458e5b
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