[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20170305224241.GA108280@athens.lkp.intel.com>
Date: Mon, 6 Mar 2017 06:42:41 +0800
From: kbuild test robot <fengguang.wu@...el.com>
To: Sachin Prabhu <sprabhu@...hat.com>
Cc: kbuild-all@...org, linux-cifs@...r.kernel.org,
samba-technical@...ts.samba.org, Steve French <smfrench@...il.com>,
Pavel Shilovsky <pshilov@...rosoft.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] fix alloc_cast.cocci warnings
fs/cifs/smb2misc.c:689:14-41: WARNING: casting value returned by memory allocation function to (struct close_cancelled_open *) 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
CC: Sachin Prabhu <sprabhu@...hat.com>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
---
smb2misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/cifs/smb2misc.c
+++ b/fs/cifs/smb2misc.c
@@ -686,7 +686,7 @@ smb2_handle_cancelled_mid(char *buffer,
(sync_hdr->Status != STATUS_SUCCESS))
return 0;
- cancelled = (struct close_cancelled_open *)
+ cancelled =
kzalloc(sizeof(struct close_cancelled_open),
GFP_KERNEL);
if (!cancelled)
Powered by blists - more mailing lists