Commit c5a0b6e4 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'vfio-v5.17-rc1' of git://github.com/awilliam/linux-vfio

Pull VFIO updates from Alex Williamson:

 - Fix sparse endian warnings in IGD code (Alex Williamson)

 - Balance kvzalloc with kvfree (Jiacheng Shi)

* tag 'vfio-v5.17-rc1' of git://github.com/awilliam/linux-vfio:
  vfio/iommu_type1: replace kfree with kvfree
  vfio/pci: Resolve sparse endian warnings in IGD support
parents 41652aae 2bed2ced
...@@ -309,13 +309,14 @@ static ssize_t vfio_pci_igd_cfg_rw(struct vfio_pci_core_device *vdev, ...@@ -309,13 +309,14 @@ static ssize_t vfio_pci_igd_cfg_rw(struct vfio_pci_core_device *vdev,
if ((pos & 3) && size > 2) { if ((pos & 3) && size > 2) {
u16 val; u16 val;
__le16 lval;
ret = pci_user_read_config_word(pdev, pos, &val); ret = pci_user_read_config_word(pdev, pos, &val);
if (ret) if (ret)
return ret; return ret;
val = cpu_to_le16(val); lval = cpu_to_le16(val);
if (copy_to_user(buf + count - size, &val, 2)) if (copy_to_user(buf + count - size, &lval, 2))
return -EFAULT; return -EFAULT;
pos += 2; pos += 2;
...@@ -324,13 +325,14 @@ static ssize_t vfio_pci_igd_cfg_rw(struct vfio_pci_core_device *vdev, ...@@ -324,13 +325,14 @@ static ssize_t vfio_pci_igd_cfg_rw(struct vfio_pci_core_device *vdev,
while (size > 3) { while (size > 3) {
u32 val; u32 val;
__le32 lval;
ret = pci_user_read_config_dword(pdev, pos, &val); ret = pci_user_read_config_dword(pdev, pos, &val);
if (ret) if (ret)
return ret; return ret;
val = cpu_to_le32(val); lval = cpu_to_le32(val);
if (copy_to_user(buf + count - size, &val, 4)) if (copy_to_user(buf + count - size, &lval, 4))
return -EFAULT; return -EFAULT;
pos += 4; pos += 4;
...@@ -339,13 +341,14 @@ static ssize_t vfio_pci_igd_cfg_rw(struct vfio_pci_core_device *vdev, ...@@ -339,13 +341,14 @@ static ssize_t vfio_pci_igd_cfg_rw(struct vfio_pci_core_device *vdev,
while (size >= 2) { while (size >= 2) {
u16 val; u16 val;
__le16 lval;
ret = pci_user_read_config_word(pdev, pos, &val); ret = pci_user_read_config_word(pdev, pos, &val);
if (ret) if (ret)
return ret; return ret;
val = cpu_to_le16(val); lval = cpu_to_le16(val);
if (copy_to_user(buf + count - size, &val, 2)) if (copy_to_user(buf + count - size, &lval, 2))
return -EFAULT; return -EFAULT;
pos += 2; pos += 2;
......
...@@ -256,7 +256,7 @@ static int vfio_dma_bitmap_alloc(struct vfio_dma *dma, size_t pgsize) ...@@ -256,7 +256,7 @@ static int vfio_dma_bitmap_alloc(struct vfio_dma *dma, size_t pgsize)
static void vfio_dma_bitmap_free(struct vfio_dma *dma) static void vfio_dma_bitmap_free(struct vfio_dma *dma)
{ {
kfree(dma->bitmap); kvfree(dma->bitmap);
dma->bitmap = NULL; dma->bitmap = NULL;
} }
......
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