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>
This commit is contained in:
Sabyasachi Gupta 2018-10-19 21:29:54 +05:30 committed by Gerd Hoffmann
parent 6a37c49a94
commit 7fea1e0f38
1 changed files with 1 additions and 2 deletions

View File

@ -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);