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:
parent
6a37c49a94
commit
7fea1e0f38
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue