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] [thread-next>] [day] [month] [year] [list]
Message-ID: <87v7r673kv.fsf@AUSNATLYNCH.amd.com>
Date: Mon, 14 Apr 2025 17:58:40 -0500
From: Nathan Lynch <nathan.lynch@....com>
To: Eder Zulian <ezulian@...hat.com>
CC: <Basavaraj.Natikar@....com>, <vkoul@...nel.org>,
	<dmaengine@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] dmaengine: ptdma: Remove unused pointer dma_cmd_cache

Eder Zulian <ezulian@...hat.com> writes:
> The pointer 'struct kmem_cache *dma_cmd_cache' was introduced in commit
> b0b4a6b10577 ("dmaengine: ptdma: register PTDMA controller as a DMA
> resource") but it was never used.
>
> Signed-off-by: Eder Zulian <ezulian@...hat.com>
> ---
>  drivers/dma/amd/ptdma/ptdma-dmaengine.c | 3 ---
>  drivers/dma/amd/ptdma/ptdma.h           | 1 -
>  2 files changed, 4 deletions(-)
>
> diff --git a/drivers/dma/amd/ptdma/ptdma-dmaengine.c b/drivers/dma/amd/ptdma/ptdma-dmaengine.c
> index 715ac3ae067b..3f7f6da05142 100644
> --- a/drivers/dma/amd/ptdma/ptdma-dmaengine.c
> +++ b/drivers/dma/amd/ptdma/ptdma-dmaengine.c
> @@ -656,8 +656,6 @@ int pt_dmaengine_register(struct pt_device *pt)
>  	kmem_cache_destroy(pt->dma_desc_cache);
>  
>  err_cache:
> -	kmem_cache_destroy(pt->dma_cmd_cache);
> -

I think you could remove the 'err_cache' label and convert the users of it
to return -ENOMEM directly, since there aren't any unmanaged allocations
to unwind:

	desc_cache_name = devm_kasprintf(pt->dev, GFP_KERNEL,
					 "%s-dmaengine-desc-cache",
					 dev_name(pt->dev));
	if (!desc_cache_name) {
		ret = -ENOMEM;
		goto err_cache;
	}

	pt->dma_desc_cache = kmem_cache_create(desc_cache_name,
					       sizeof(struct pt_dma_desc), 0,
					       SLAB_HWCACHE_ALIGN, NULL);
	if (!pt->dma_desc_cache) {
		ret = -ENOMEM;
		goto err_cache;
	}

Otherwise LGTM.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ