Commit 7fea1e0f authored by Sabyasachi Gupta's avatar Sabyasachi Gupta Committed by Gerd Hoffmann

gpu/drm/virtio/virtgpu_vq.c: Use kmem_cache_zalloc

Replaced kmem_cache_alloc + memset with kmem_cache_zalloc
Signed-off-by: default avatarSabyasachi Gupta <sabyasachi.linux@gmail.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/5bc9ff7e.1c69fb81.105c2.1fef@mx.google.comSigned-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 6a37c49a
...@@ -78,10 +78,9 @@ virtio_gpu_get_vbuf(struct virtio_gpu_device *vgdev, ...@@ -78,10 +78,9 @@ virtio_gpu_get_vbuf(struct virtio_gpu_device *vgdev,
{ {
struct virtio_gpu_vbuffer *vbuf; struct virtio_gpu_vbuffer *vbuf;
vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL); vbuf = kmem_cache_zalloc(vgdev->vbufs, GFP_KERNEL);
if (!vbuf) if (!vbuf)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
memset(vbuf, 0, VBUFFER_SIZE);
BUG_ON(size > MAX_INLINE_CMD_SIZE); BUG_ON(size > MAX_INLINE_CMD_SIZE);
vbuf->buf = (void *)vbuf + sizeof(*vbuf); vbuf->buf = (void *)vbuf + sizeof(*vbuf);
......
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