Commit 93b05cba authored by Linus Torvalds's avatar Linus Torvalds

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()
parents 84621c9b 05c54de8
...@@ -956,6 +956,10 @@ static void virtscsi_remove(struct virtio_device *vdev) ...@@ -956,6 +956,10 @@ static void virtscsi_remove(struct virtio_device *vdev)
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int virtscsi_freeze(struct virtio_device *vdev) 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); virtscsi_remove_vqs(vdev);
return 0; return 0;
} }
...@@ -964,8 +968,17 @@ static int virtscsi_restore(struct virtio_device *vdev) ...@@ -964,8 +968,17 @@ static int virtscsi_restore(struct virtio_device *vdev)
{ {
struct Scsi_Host *sh = virtio_scsi_host(vdev); struct Scsi_Host *sh = virtio_scsi_host(vdev);
struct virtio_scsi *vscsi = shost_priv(sh); struct virtio_scsi *vscsi = shost_priv(sh);
int err;
err = virtscsi_init(vdev, vscsi);
if (err)
return err;
return virtscsi_init(vdev, vscsi); err = register_hotcpu_notifier(&vscsi->nb);
if (err)
vdev->config->del_vqs(vdev);
return err;
} }
#endif #endif
......
...@@ -369,7 +369,7 @@ static const struct address_space_operations virtio_balloon_aops; ...@@ -369,7 +369,7 @@ static const struct address_space_operations virtio_balloon_aops;
* This function preforms the balloon page migration task. * This function preforms the balloon page migration task.
* Called through balloon_mapping->a_ops->migratepage * Called through balloon_mapping->a_ops->migratepage
*/ */
int virtballoon_migratepage(struct address_space *mapping, static int virtballoon_migratepage(struct address_space *mapping,
struct page *newpage, struct page *page, enum migrate_mode mode) struct page *newpage, struct page *page, enum migrate_mode mode)
{ {
struct balloon_dev_info *vb_dev_info = balloon_page_device(page); struct balloon_dev_info *vb_dev_info = balloon_page_device(page);
......
...@@ -742,7 +742,6 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, ...@@ -742,7 +742,6 @@ static int virtio_pci_probe(struct pci_dev *pci_dev,
return 0; return 0;
out_set_drvdata: out_set_drvdata:
pci_set_drvdata(pci_dev, NULL);
pci_iounmap(pci_dev, vp_dev->ioaddr); pci_iounmap(pci_dev, vp_dev->ioaddr);
out_req_regions: out_req_regions:
pci_release_regions(pci_dev); pci_release_regions(pci_dev);
...@@ -760,7 +759,6 @@ static void virtio_pci_remove(struct pci_dev *pci_dev) ...@@ -760,7 +759,6 @@ static void virtio_pci_remove(struct pci_dev *pci_dev)
unregister_virtio_device(&vp_dev->vdev); unregister_virtio_device(&vp_dev->vdev);
vp_del_vqs(&vp_dev->vdev); vp_del_vqs(&vp_dev->vdev);
pci_set_drvdata(pci_dev, NULL);
pci_iounmap(pci_dev, vp_dev->ioaddr); pci_iounmap(pci_dev, vp_dev->ioaddr);
pci_release_regions(pci_dev); pci_release_regions(pci_dev);
pci_disable_device(pci_dev); pci_disable_device(pci_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment