Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2391f0b4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull virtio fixes from Michael Tsirkin:
 "virtio and qemu bugfixes

  A couple of bugfixes that just became ready"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  virtio_balloon: fix increment of vb->num_pfns in fill_balloon()
  virtio: release virtio index when fail to device_register
  fw_cfg: fix driver remove
parents 236fa078 d9e427f6
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -582,9 +582,10 @@ static int fw_cfg_sysfs_remove(struct platform_device *pdev)
{
{
	pr_debug("fw_cfg: unloading.\n");
	pr_debug("fw_cfg: unloading.\n");
	fw_cfg_sysfs_cache_cleanup();
	fw_cfg_sysfs_cache_cleanup();
	sysfs_remove_file(fw_cfg_top_ko, &fw_cfg_rev_attr.attr);
	fw_cfg_io_cleanup();
	fw_cfg_kset_unregister_recursive(fw_cfg_fname_kset);
	fw_cfg_kset_unregister_recursive(fw_cfg_fname_kset);
	fw_cfg_kobj_cleanup(fw_cfg_sel_ko);
	fw_cfg_kobj_cleanup(fw_cfg_sel_ko);
	fw_cfg_io_cleanup();
	return 0;
	return 0;
}
}


+2 −0
Original line number Original line Diff line number Diff line
@@ -333,6 +333,8 @@ int register_virtio_device(struct virtio_device *dev)
	/* device_register() causes the bus infrastructure to look for a
	/* device_register() causes the bus infrastructure to look for a
	 * matching driver. */
	 * matching driver. */
	err = device_register(&dev->dev);
	err = device_register(&dev->dev);
	if (err)
		ida_simple_remove(&virtio_index_ida, dev->index);
out:
out:
	if (err)
	if (err)
		virtio_add_status(dev, VIRTIO_CONFIG_S_FAILED);
		virtio_add_status(dev, VIRTIO_CONFIG_S_FAILED);
+1 −2
Original line number Original line Diff line number Diff line
@@ -174,13 +174,12 @@ static unsigned fill_balloon(struct virtio_balloon *vb, size_t num)
	while ((page = balloon_page_pop(&pages))) {
	while ((page = balloon_page_pop(&pages))) {
		balloon_page_enqueue(&vb->vb_dev_info, page);
		balloon_page_enqueue(&vb->vb_dev_info, page);


		vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE;

		set_page_pfns(vb, vb->pfns + vb->num_pfns, page);
		set_page_pfns(vb, vb->pfns + vb->num_pfns, page);
		vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE;
		vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE;
		if (!virtio_has_feature(vb->vdev,
		if (!virtio_has_feature(vb->vdev,
					VIRTIO_BALLOON_F_DEFLATE_ON_OOM))
					VIRTIO_BALLOON_F_DEFLATE_ON_OOM))
			adjust_managed_page_count(page, -1);
			adjust_managed_page_count(page, -1);
		vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE;
	}
	}


	num_allocated_pages = vb->num_pfns;
	num_allocated_pages = vb->num_pfns;