[PATCH] drm/virtio: use kvmalloc for large allocations

Gerd Hoffmann kraxel at redhat.com
Thu Nov 5 11:34:25 UTC 2020


On Thu, Nov 05, 2020 at 04:00:54PM +0900, Sergey Senozhatsky wrote:
> Hi,
> 
> On (20/11/05 07:52), Gerd Hoffmann wrote:
> > > -	*ents = kmalloc_array(*nents, sizeof(struct virtio_gpu_mem_entry),
> > > -			      GFP_KERNEL);
> > > +	*ents = kvmalloc_array(*nents,
> > > +			       sizeof(struct virtio_gpu_mem_entry),
> > > +			       GFP_KERNEL);
> > 
> > Shouldn't that be balanced with a kvfree() elsewhere?
> 
> I think it already is. ents pointer is assigned to vbuf->data_buf,
> and free_vbuf() already uses kvfree(vbuf->data_buf) to free it.

Ah, right, we needed that before elsewhere.
Ok then, pushed to drm-misc-next.

thanks,
  Gerd



More information about the dri-devel mailing list