mirror of
https://github.com/torvalds/linux.git
synced 2026-09-11 20:13:02 +02:00
virtio_input: reset device if input_register_device() fails
Probe marks the device DRIVER_OK with virtio_device_ready() before
calling input_register_device(). If registration fails, the error path
cleared vi->ready and called del_vqs() while the device was still live,
so the device could keep DMA to queues that were already torn down.
Match remove/freeze: call virtio_reset_device() on that path before
tearing down the virtqueues.
Fixes: 271c865161 ("Add virtio-input driver.")
Signed-off-by: Xiong Weimin <xiongweimin@kylinos.cn>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260805032931.1606652-1-xiongweimin@kylinos.cn>
This commit is contained in:
parent
e4f4761879
commit
81489b32a2
|
|
@ -331,6 +331,7 @@ static int virtinput_probe(struct virtio_device *vdev)
|
|||
spin_lock_irqsave(&vi->lock, flags);
|
||||
vi->ready = false;
|
||||
spin_unlock_irqrestore(&vi->lock, flags);
|
||||
virtio_reset_device(vdev);
|
||||
err_mt_init_slots:
|
||||
input_free_device(vi->idev);
|
||||
err_input_alloc:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user