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]
Date:   Sat, 26 Mar 2022 16:09:00 +0800
From:   kernel test robot <lkp@...el.com>
To:     Andi Kleen <ak@...ux.intel.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Kuppuswamy Sathyanarayanan 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>
Subject: [PATCH] swiotlb: fix alloc_cast.cocci warnings

From: kernel test robot <lkp@...el.com>

kernel/dma/swiotlb.c:433:15-33: WARNING: casting value returned by memory allocation function to (struct io_tlb_area *) is useless.

 Remove casting the values returned by memory allocation functions
 like kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc.

Semantic patch information:
 This makes an effort to find cases of casting of values returned by
 kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc,
 kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes
 the casting as it is not required. The result in the patch case may
 need some reformatting.

Generated by: scripts/coccinelle/api/alloc/alloc_cast.cocci

Fixes: 4ab45cefa80f ("swiotlb: Split up single swiotlb lock")
CC: Andi Kleen <ak@...ux.intel.com>
Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: kernel test robot <lkp@...el.com>
---

tree:   https://github.com/intel/tdx.git guest-rebased
head:   4c095660b91dbdd18042456e395af0deeef93485
commit: 4ab45cefa80f97ba2bdc31226523c891832d1080 [65/83] swiotlb: Split up single swiotlb lock
:::::: branch date: 13 hours ago
:::::: commit date: 3 days ago

 kernel/dma/swiotlb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -430,7 +430,7 @@ swiotlb_late_init_with_tbl(char *tlb, un
 		return -ENOMEM;
 	}
 
-	mem->areas = (struct io_tlb_area *)kcalloc(num_areas,
+	mem->areas = kcalloc(num_areas,
 						   sizeof(struct io_tlb_area),
 						   GFP_KERNEL);
 	if (!mem->areas) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ