lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181023135855.GU324@phenom.ffwll.local>
Date:   Tue, 23 Oct 2018 15:58:55 +0200
From:   Daniel Vetter <daniel@...ll.ch>
To:     Souptick Joarder <jrdr.linux@...il.com>
Cc:     gustavo@...ovan.org, maarten.lankhorst@...ux.intel.com,
        sean@...rly.run, airlied@...ux.ie, brajeswar.linux@...il.com,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        sabyasachi.linux@...il.com
Subject: Re: [PATCH] drm/drm_pci.c: Use dma_zalloc_coherent

On Tue, Oct 23, 2018 at 09:32:22AM +0530, Souptick Joarder wrote:
> Replace dma_alloc_coherent + memset with dma_zalloc_coherent.
> 
> Signed-off-by: Souptick Joarder <jrdr.linux@...il.com>

Applied, thanks for your patch.
-Daniel

> ---
>  drivers/gpu/drm/drm_pci.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> index 896e42a..1427879 100644
> --- a/drivers/gpu/drm/drm_pci.c
> +++ b/drivers/gpu/drm/drm_pci.c
> @@ -61,15 +61,14 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali
>  		return NULL;
>  
>  	dmah->size = size;
> -	dmah->vaddr = dma_alloc_coherent(&dev->pdev->dev, size, &dmah->busaddr, GFP_KERNEL | __GFP_COMP);
> +	dmah->vaddr = dma_zalloc_coherent(&dev->pdev->dev, size, &dmah->busaddr,
> +						GFP_KERNEL | __GFP_COMP);
>  
>  	if (dmah->vaddr == NULL) {
>  		kfree(dmah);
>  		return NULL;
>  	}
>  
> -	memset(dmah->vaddr, 0, size);
> -
>  	/* XXX - Is virt_to_page() legal for consistent mem? */
>  	/* Reserve */
>  	for (addr = (unsigned long)dmah->vaddr, sz = size;
> -- 
> 1.9.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ