aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 01:24:35 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 01:24:35 -0500
commit93b05cba8ed52a751da9c4c7da6c97bc514bec77 (patch)
tree7768ff8c9abfe54b1ac9f6c6ecb2e5c0f91ed507
parent84621c9b18d0bb6cb267e3395c7f3131ecf4d39c (diff)
parent05c54de8c88c02bd0a44de8316d5e276b856632e (diff)
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()
-rw-r--r--drivers/scsi/virtio_scsi.c15
-rw-r--r--drivers/virtio/virtio_balloon.c2
-rw-r--r--drivers/virtio/virtio_pci.c2
3 files changed, 15 insertions, 4 deletions
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index c3173dced870..16bfd50cd3fe 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)
956#ifdef CONFIG_PM_SLEEP 956#ifdef CONFIG_PM_SLEEP
957static int virtscsi_freeze(struct virtio_device *vdev) 957static int virtscsi_freeze(struct virtio_device *vdev)
958{ 958{
959 struct Scsi_Host *sh = virtio_scsi_host(vdev);
960 struct virtio_scsi *vscsi = shost_priv(sh);
961
962 unregister_hotcpu_notifier(&vscsi->nb);
959 virtscsi_remove_vqs(vdev); 963 virtscsi_remove_vqs(vdev);
960 return 0; 964 return 0;
961} 965}
@@ -964,8 +968,17 @@ static int virtscsi_restore(struct virtio_device *vdev)
964{ 968{
965 struct Scsi_Host *sh = virtio_scsi_host(vdev); 969 struct Scsi_Host *sh = virtio_scsi_host(vdev);
966 struct virtio_scsi *vscsi = shost_priv(sh); 970 struct virtio_scsi *vscsi = shost_priv(sh);
971 int err;
972
973 err = virtscsi_init(vdev, vscsi);
974 if (err)
975 return err;
976
977 err = register_hotcpu_notifier(&vscsi->nb);
978 if (err)
979 vdev->config->del_vqs(vdev);
967 980
968 return virtscsi_init(vdev, vscsi); 981 return err;
969} 982}
970#endif 983#endif
971 984
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 5c4a95b516cf..34bdabaecbd6 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -369,7 +369,7 @@ static const struct address_space_operations virtio_balloon_aops;
369 * This function preforms the balloon page migration task. 369 * This function preforms the balloon page migration task.
370 * Called through balloon_mapping->a_ops->migratepage 370 * Called through balloon_mapping->a_ops->migratepage
371 */ 371 */
372int virtballoon_migratepage(struct address_space *mapping, 372static int virtballoon_migratepage(struct address_space *mapping,
373 struct page *newpage, struct page *page, enum migrate_mode mode) 373 struct page *newpage, struct page *page, enum migrate_mode mode)
374{ 374{
375 struct balloon_dev_info *vb_dev_info = balloon_page_device(page); 375 struct balloon_dev_info *vb_dev_info = balloon_page_device(page);
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index a37c69941d30..a416f9b2a7f6 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -742,7 +742,6 @@ static int virtio_pci_probe(struct pci_dev *pci_dev,
742 return 0; 742 return 0;
743 743
744out_set_drvdata: 744out_set_drvdata:
745 pci_set_drvdata(pci_dev, NULL);
746 pci_iounmap(pci_dev, vp_dev->ioaddr); 745 pci_iounmap(pci_dev, vp_dev->ioaddr);
747out_req_regions: 746out_req_regions:
748 pci_release_regions(pci_dev); 747 pci_release_regions(pci_dev);
@@ -760,7 +759,6 @@ static void virtio_pci_remove(struct pci_dev *pci_dev)
760 unregister_virtio_device(&vp_dev->vdev); 759 unregister_virtio_device(&vp_dev->vdev);
761 760
762 vp_del_vqs(&vp_dev->vdev); 761 vp_del_vqs(&vp_dev->vdev);
763 pci_set_drvdata(pci_dev, NULL);
764 pci_iounmap(pci_dev, vp_dev->ioaddr); 762 pci_iounmap(pci_dev, vp_dev->ioaddr);
765 pci_release_regions(pci_dev); 763 pci_release_regions(pci_dev);
766 pci_disable_device(pci_dev); 764 pci_disable_device(pci_dev);