Re: [PATCH] drm/nouveau: fix several DMA buffer leaks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]<

 



On Thu, 2024-02-01 at 13:55 -0600, Timur Tabi wrote:
> +static void
> +nvkm_gsp_mem_dtor(struct nvkm_gsp *gsp, struct nvkm_gsp_mem *mem)
> +{
> +       if (mem->data) {
> +               dma_free_coherent(gsp->subdev.device->dev, mem->size, mem-
> >data, mem->addr);
> +               mem->data = NULL;
> +               mem->addr = 0;
> +       }
> +}

Dave, what do you think about doing this:

if (mem->data) {

	memset(mem->data, 0, mem->size);   <-------

	dma_free_coherent(gsp->subdev.device->dev, mem->size,
mem->data, mem->addr);
	mem->data = NULL;
	mem->addr = 0;
}

This would help situations where a buffer is access by GSP-RM after we think
it's safe to free it.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux