diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-22 22:24:35 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-22 22:24:35 -0800 |
commit | 93b05cba8ed52a751da9c4c7da6c97bc514bec77 (patch) | |
tree | 7768ff8c9abfe54b1ac9f6c6ecb2e5c0f91ed507 /drivers/scsi | |
parent | 84621c9b18d0bb6cb267e3395c7f3131ecf4d39c (diff) | |
parent | 05c54de8c88c02bd0a44de8316d5e276b856632e (diff) | |
download | op-kernel-dev-93b05cba8ed52a751da9c4c7da6c97bc514bec77.zip op-kernel-dev-93b05cba8ed52a751da9c4c7da6c97bc514bec77.tar.gz |
Merge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull virtio update from Rusty Russell:
"A few simple fixes. Quiet cycle"
* tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
drivers: virtio: Mark function virtballoon_migratepage() as static in virtio_balloon.c
virtio-scsi: Fix hotcpu_notifier use-after-free with virtscsi_freeze
virtio: pci: remove unnecessary pci_set_drvdata()
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/virtio_scsi.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index c3173dc..16bfd50 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -956,6 +956,10 @@ static void virtscsi_remove(struct virtio_device *vdev) #ifdef CONFIG_PM_SLEEP static int virtscsi_freeze(struct virtio_device *vdev) { + struct Scsi_Host *sh = virtio_scsi_host(vdev); + struct virtio_scsi *vscsi = shost_priv(sh); + + unregister_hotcpu_notifier(&vscsi->nb); virtscsi_remove_vqs(vdev); return 0; } @@ -964,8 +968,17 @@ static int virtscsi_restore(struct virtio_device *vdev) { struct Scsi_Host *sh = virtio_scsi_host(vdev); struct virtio_scsi *vscsi = shost_priv(sh); + int err; + + err = virtscsi_init(vdev, vscsi); + if (err) + return err; + + err = register_hotcpu_notifier(&vscsi->nb); + if (err) + vdev->config->del_vqs(vdev); - return virtscsi_init(vdev, vscsi); + return err; } #endif |