drm/virtio: Fix driver removal with disabled KMS

JIRA: https://issues.redhat.com/browse/RHEL-180329

commit 15e561869a8b4e4db69733be1d6f33770664f989
Author: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Date:   Thu Jun 4 15:27:43 2026 +0300

    drm/virtio: Fix driver removal with disabled KMS

    [ Upstream commit f329e8325e054bd6d84d10904f8dd51137281b92 ]

    DRM atomic and modesetting aren't initialized if virtio-gpu driver built
    with disabled KMS, leading to access of uninitialized data on driver
    removal/unbinding and crashing kernel. Fix it by skipping shutting down
    atomic core with unavailable KMS.

    Fixes: 72122c69d717 ("drm/virtio: Add option to disable KMS support")
    Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
    Tested-by: Ryosuke Yasuoka <ryasuoka@redhat.com>
    Reviewed-by: Ryosuke Yasuoka <ryasuoka@redhat.com>
    Link: https://patch.msgid.link/20260604122743.13383-1-dmitry.osipenko@collabora.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
This commit is contained in:
Anusha Srivatsa
2026-08-03 14:53:55 -05:00
parent 254924bd55
commit 5c46073901
+4 -1
View File
@@ -124,7 +124,10 @@ static void virtio_gpu_remove(struct virtio_device *vdev)
struct drm_device *dev = vdev->priv;
drm_dev_unplug(dev);
drm_atomic_helper_shutdown(dev);
if (drm_core_check_feature(dev, DRIVER_ATOMIC))
drm_atomic_helper_shutdown(dev);
virtio_gpu_deinit(dev);
drm_dev_put(dev);
}