diff options
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_vq.c')
| -rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_vq.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 0c194b4e9488..9a45a58e9f58 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -312,7 +312,7 @@ static struct sg_table *vmalloc_to_sgt(char *data, uint32_t size, int *sg_ents) if (WARN_ON(!PAGE_ALIGNED(data))) return NULL; - sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kmalloc_obj(*sgt, GFP_KERNEL); if (!sgt) return NULL; @@ -936,8 +936,7 @@ int virtio_gpu_cmd_get_display_info(struct virtio_gpu_device *vgdev) struct virtio_gpu_vbuffer *vbuf; void *resp_buf; - resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_display_info), - GFP_KERNEL); + resp_buf = kzalloc_obj(struct virtio_gpu_resp_display_info, GFP_KERNEL); if (!resp_buf) return -ENOMEM; @@ -959,8 +958,7 @@ int virtio_gpu_cmd_get_capset_info(struct virtio_gpu_device *vgdev, int idx) struct virtio_gpu_vbuffer *vbuf; void *resp_buf; - resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_capset_info), - GFP_KERNEL); + resp_buf = kzalloc_obj(struct virtio_gpu_resp_capset_info, GFP_KERNEL); if (!resp_buf) return -ENOMEM; @@ -995,7 +993,7 @@ int virtio_gpu_cmd_get_capset(struct virtio_gpu_device *vgdev, if (version > vgdev->capsets[idx].max_version) return -EINVAL; - cache_ent = kzalloc(sizeof(*cache_ent), GFP_KERNEL); + cache_ent = kzalloc_obj(*cache_ent, GFP_KERNEL); if (!cache_ent) return -ENOMEM; @@ -1063,8 +1061,7 @@ int virtio_gpu_cmd_get_edids(struct virtio_gpu_device *vgdev) return -EINVAL; for (scanout = 0; scanout < vgdev->num_scanouts; scanout++) { - resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_edid), - GFP_KERNEL); + resp_buf = kzalloc_obj(struct virtio_gpu_resp_edid, GFP_KERNEL); if (!resp_buf) return -ENOMEM; @@ -1341,7 +1338,7 @@ virtio_gpu_cmd_resource_assign_uuid(struct virtio_gpu_device *vgdev, struct virtio_gpu_vbuffer *vbuf; struct virtio_gpu_resp_resource_uuid *resp_buf; - resp_buf = kzalloc(sizeof(*resp_buf), GFP_KERNEL); + resp_buf = kzalloc_obj(*resp_buf, GFP_KERNEL); if (!resp_buf) { spin_lock(&vgdev->resource_export_lock); bo->uuid_state = STATE_ERR; @@ -1394,7 +1391,7 @@ int virtio_gpu_cmd_map(struct virtio_gpu_device *vgdev, struct virtio_gpu_vbuffer *vbuf; struct virtio_gpu_resp_map_info *resp_buf; - resp_buf = kzalloc(sizeof(*resp_buf), GFP_KERNEL); + resp_buf = kzalloc_obj(*resp_buf, GFP_KERNEL); if (!resp_buf) return -ENOMEM; |
