VFIO updates for v5.17-rc1
- Fix sparse endian warnings in IGD code (Alex Williamson) - Balance kvzalloc with kvfree (Jiacheng Shi) -----BEGIN PGP SIGNATURE----- iQJPBAABCAA5FiEEQvbATlQL0amee4qQI5ubbjuwiyIFAmHoTmkbHGFsZXgud2ls bGlhbXNvbkByZWRoYXQuY29tAAoJECObm247sIsicMcQALJcjkN9z2GvFpI7iFN8 6xA7P1MNZ5kU6aHy/hyY/DwukrCHvx5hLc3Xro9ng4JkmP7+2GeUfyV3AlNDUId3 gaZCGgLjmNQY9wxOfT1WiU6oDbvNuGNBL3WxrhAB/DLrjowhEM1hiYL9JBqSeZfB FapfdpBsBrTtpuAbI1daE5qsYSaVzL4NY14ulFOXVvN3sVhPU4byXhgvczGbT8o+ c/lllFG5cXxB89n8TPggvLGyBpJIvHqdKfCTcn8+MrimC3iVkoOAlu9HFWDe2wPA Nt9OrKb7hSy7Q7gBJtwS5k8I531b+ovdzguVoATw8VZfUB08tz4NMn8X5xQUCapI T1Bhma1Ua8TH11i2acl5RsktJAkSQeZ8IWt1AQ6hBeTI7Z19iUleYi+71n6+rePB N5MH7snTqOgdYIK2sLpb2QKHBsEmAn+dG8cf/g0FRD143ce24P4A8fMbuBIO9PeM 129mnlV5q8GluYc8+F9ppGX29lrD9N21TTt2yGj6X55IRzJQ8CJXg8O0y+GztQSn P634BRNQE7zw8w4y6XzaTKQPu43yD+VvB9qpIH0HB56RaJOubfpq9Fd07niE3dZR CHMfwDoihAIaknuwWqf1DnwMMbn9uzOlUKerrbI8v4DTZd5LDuSJ7chiBB7ra8g7 zDU+seQ5EI1rlNrwbTHp110R =MGt6 -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
c5a0b6e40d
@ -309,13 +309,14 @@ static ssize_t vfio_pci_igd_cfg_rw(struct vfio_pci_core_device *vdev,
|
||||
|
||||
if ((pos & 3) && size > 2) {
|
||||
u16 val;
|
||||
__le16 lval;
|
||||
|
||||
ret = pci_user_read_config_word(pdev, pos, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
val = cpu_to_le16(val);
|
||||
if (copy_to_user(buf + count - size, &val, 2))
|
||||
lval = cpu_to_le16(val);
|
||||
if (copy_to_user(buf + count - size, &lval, 2))
|
||||
return -EFAULT;
|
||||
|
||||
pos += 2;
|
||||
@ -324,13 +325,14 @@ static ssize_t vfio_pci_igd_cfg_rw(struct vfio_pci_core_device *vdev,
|
||||
|
||||
while (size > 3) {
|
||||
u32 val;
|
||||
__le32 lval;
|
||||
|
||||
ret = pci_user_read_config_dword(pdev, pos, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
val = cpu_to_le32(val);
|
||||
if (copy_to_user(buf + count - size, &val, 4))
|
||||
lval = cpu_to_le32(val);
|
||||
if (copy_to_user(buf + count - size, &lval, 4))
|
||||
return -EFAULT;
|
||||
|
||||
pos += 4;
|
||||
@ -339,13 +341,14 @@ static ssize_t vfio_pci_igd_cfg_rw(struct vfio_pci_core_device *vdev,
|
||||
|
||||
while (size >= 2) {
|
||||
u16 val;
|
||||
__le16 lval;
|
||||
|
||||
ret = pci_user_read_config_word(pdev, pos, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
val = cpu_to_le16(val);
|
||||
if (copy_to_user(buf + count - size, &val, 2))
|
||||
lval = cpu_to_le16(val);
|
||||
if (copy_to_user(buf + count - size, &lval, 2))
|
||||
return -EFAULT;
|
||||
|
||||
pos += 2;
|
||||
|
@ -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)
|
||||
{
|
||||
kfree(dma->bitmap);
|
||||
kvfree(dma->bitmap);
|
||||
dma->bitmap = NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user