Commit 417385c4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull virtio fixes from Michael Tsirkin:
 "A couple of last minute bugfixes"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  virtio-mem: Fix build error due to improper use 'select'
  virtio_balloon: fix up endian-ness for free cmd id
  virtio-balloon: Document byte ordering of poison_val
  vhost/scsi: fix up req type endian-ness
  firmware: Fix a reference count leak.
parents aa54ea90 a96b0d06
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -605,8 +605,10 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f)
	/* register entry under "/sys/firmware/qemu_fw_cfg/by_key/" */
	err = kobject_init_and_add(&entry->kobj, &fw_cfg_sysfs_entry_ktype,
				   fw_cfg_sel_ko, "%d", entry->select);
	if (err)
		goto err_register;
	if (err) {
		kobject_put(&entry->kobj);
		return err;
	}

	/* add raw binary content access */
	err = sysfs_create_bin_file(&entry->kobj, &fw_cfg_sysfs_attr_raw);
@@ -622,7 +624,6 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f)

err_add_raw:
	kobject_del(&entry->kobj);
err_register:
	kfree(entry);
	return err;
}
+1 −1
Original line number Diff line number Diff line
@@ -1215,7 +1215,7 @@ vhost_scsi_ctl_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
			continue;
		}

		switch (v_req.type) {
		switch (vhost32_to_cpu(vq, v_req.type)) {
		case VIRTIO_SCSI_T_TMF:
			vc.req = &v_req.tmf;
			vc.req_size = sizeof(struct virtio_scsi_ctrl_tmf_req);
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ config VIRTIO_MEM
	depends on VIRTIO
	depends on MEMORY_HOTPLUG_SPARSE
	depends on MEMORY_HOTREMOVE
	select CONTIG_ALLOC
	depends on CONTIG_ALLOC
	help
	 This driver provides access to virtio-mem paravirtualized memory
	 devices, allowing to hotplug and hotunplug memory.
+10 −1
Original line number Diff line number Diff line
@@ -578,10 +578,14 @@ static int init_vqs(struct virtio_balloon *vb)
static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
{
	if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
			       &vb->config_read_bitmap))
			       &vb->config_read_bitmap)) {
		virtio_cread(vb->vdev, struct virtio_balloon_config,
			     free_page_hint_cmd_id,
			     &vb->cmd_id_received_cache);
		/* Legacy balloon config space is LE, unlike all other devices. */
		if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_1))
			vb->cmd_id_received_cache = le32_to_cpu((__force __le32)vb->cmd_id_received_cache);
	}

	return vb->cmd_id_received_cache;
}
@@ -974,6 +978,11 @@ static int virtballoon_probe(struct virtio_device *vdev)
		/*
		 * Let the hypervisor know that we are expecting a
		 * specific value to be written back in balloon pages.
		 *
		 * If the PAGE_POISON value was larger than a byte we would
		 * need to byte swap poison_val here to guarantee it is
		 * little-endian. However for now it is a single byte so we
		 * can pass it as-is.
		 */
		if (!want_init_on_free())
			memset(&poison_val, PAGE_POISON, sizeof(poison_val));