diff options
author | Sabyasachi Gupta <sabyasachi.linux@gmail.com> | 2018-10-19 21:29:54 +0530 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-10-30 07:19:58 +0100 |
commit | 7fea1e0f38a86d2b79ac0a7f31843b4eb55ccb60 (patch) | |
tree | 81a35749d301d9322ef3cda4828e9dde255a8310 /drivers/gpu/drm/virtio/virtgpu_vq.c | |
parent | 6a37c49a94a95d4cd8ce4e7466f3bbb17e80ca64 (diff) | |
download | lwn-7fea1e0f38a86d2b79ac0a7f31843b4eb55ccb60.tar.gz lwn-7fea1e0f38a86d2b79ac0a7f31843b4eb55ccb60.zip |
gpu/drm/virtio/virtgpu_vq.c: Use kmem_cache_zalloc
Replaced kmem_cache_alloc + memset with kmem_cache_zalloc
Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/5bc9ff7e.1c69fb81.105c2.1fef@mx.google.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_vq.c')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_vq.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index d2861da2bbc9..51bef1775e47 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -78,10 +78,9 @@ virtio_gpu_get_vbuf(struct virtio_gpu_device *vgdev, { struct virtio_gpu_vbuffer *vbuf; - vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL); + vbuf = kmem_cache_zalloc(vgdev->vbufs, GFP_KERNEL); if (!vbuf) return ERR_PTR(-ENOMEM); - memset(vbuf, 0, VBUFFER_SIZE); BUG_ON(size > MAX_INLINE_CMD_SIZE); vbuf->buf = (void *)vbuf + sizeof(*vbuf); |