Skip to content

Commit

Permalink
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/mst/vhost

Pull virtio fix from Michael Tsirkin:
 "A last minute fix for the new virtio input driver.  It seems pretty
   obvious, and the problem it's fixing would be quite hard to debug"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  virtio-input: reset device and detach unused during remove
  • Loading branch information
Linus Torvalds committed Aug 8, 2015
2 parents 39171c8 + df4198b commit b3b98a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/virtio/virtio_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,17 @@ static int virtinput_probe(struct virtio_device *vdev)
static void virtinput_remove(struct virtio_device *vdev)
{
struct virtio_input *vi = vdev->priv;
void *buf;
unsigned long flags;

spin_lock_irqsave(&vi->lock, flags);
vi->ready = false;
spin_unlock_irqrestore(&vi->lock, flags);

input_unregister_device(vi->idev);
vdev->config->reset(vdev);
while ((buf = virtqueue_detach_unused_buf(vi->sts)) != NULL)
kfree(buf);
vdev->config->del_vqs(vdev);
kfree(vi);
}
Expand Down

0 comments on commit b3b98a5

Please sign in to comment.