mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
drm/virtio: Fix driver removal with disabled KMS
[ Upstream commitf329e8325e] 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:72122c69d7("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c5f438dd2f
commit
ed3e134700
@@ -118,7 +118,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user