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-next>] [day] [month] [year] [list]
Message-Id: <20240630011215.42525-1-thorsten.blum@toblux.com>
Date: Sun, 30 Jun 2024 03:12:16 +0200
From: Thorsten Blum <thorsten.blum@...lux.com>
To: akpm@...ux-foundation.org,
	jack@...e.cz,
	surenb@...gle.com
Cc: linux-kernel@...r.kernel.org,
	Thorsten Blum <thorsten.blum@...lux.com>
Subject: [PATCH] dma-buf: Remove unnecessary kmalloc() cast

Casting the return value of kmalloc() is unnecessary and can be
removed. Remove it and fix the following Coccinelle/coccicheck warning
reported by alloc_cast.cocci:

  WARNING: casting value returned by memory allocation function to (struct dma_fence_chain *) is useless.

Compile-tested only.

Signed-off-by: Thorsten Blum <thorsten.blum@...lux.com>
---
 include/linux/dma-fence-chain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/dma-fence-chain.h b/include/linux/dma-fence-chain.h
index ad9e2506c2f4..a9dc82e1b7f3 100644
--- a/include/linux/dma-fence-chain.h
+++ b/include/linux/dma-fence-chain.h
@@ -87,7 +87,7 @@ dma_fence_chain_contained(struct dma_fence *fence)
  * Returns a new struct dma_fence_chain object or NULL on failure.
  */
 #define dma_fence_chain_alloc()	\
-		((struct dma_fence_chain *)kmalloc(sizeof(struct dma_fence_chain), GFP_KERNEL))
+		kmalloc(sizeof(struct dma_fence_chain), GFP_KERNEL)
 
 /**
  * dma_fence_chain_free
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ