[PATCH net-next] ceph: Delete useless kfree code

Subsystems: ceph common code (libceph), the rest

STALE2090d

3 messages, 3 authors, 2020-12-18 · open the first message on its own page

[PATCH net-next] ceph: Delete useless kfree code

From: Zheng Yongjun <hidden>
Date: 2020-12-16 13:03:04

The parameter of kfree function is NULL, so kfree code is useless, delete it.

Signed-off-by: Zheng Yongjun <redacted>
---
 net/ceph/osdmap.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c
index fa08c15be0c0..6e6387c6b7bf 100644
--- a/net/ceph/osdmap.c
+++ b/net/ceph/osdmap.c
@@ -285,7 +285,6 @@ static u32 *decode_array_32_alloc(void **p, void *end, u32 *plen)
 e_inval:
 	ret = -EINVAL;
 fail:
-	kfree(a);
 	return ERR_PTR(ret);
 }
 
-- 
2.22.0

Re: [PATCH net-next] ceph: Delete useless kfree code

From: Jakub Kicinski <kuba@kernel.org>
Date: 2020-12-17 01:21:31

On Wed, 16 Dec 2020 21:02:39 +0800 Zheng Yongjun wrote:
The parameter of kfree function is NULL, so kfree code is useless, delete it.

Signed-off-by: Zheng Yongjun <redacted>
To be clear the subject tags is misleading we're not taking this 
into the networking tree, ceph folk please go ahead :)

Re: [PATCH net-next] ceph: Delete useless kfree code

From: Ilya Dryomov <idryomov@gmail.com>
Date: 2020-12-18 13:59:31

On Thu, Dec 17, 2020 at 2:25 AM Jakub Kicinski [off-list ref] wrote:
On Wed, 16 Dec 2020 21:02:39 +0800 Zheng Yongjun wrote:
quoted
The parameter of kfree function is NULL, so kfree code is useless, delete it.

Signed-off-by: Zheng Yongjun <redacted>
To be clear the subject tags is misleading we're not taking this
into the networking tree, ceph folk please go ahead :)
I still didn't get the original patch for some reason, but looking at

  https://lists.openwall.net/netdev/2020/12/16/163

the kfree is not useless.  If ceph_decode_need() fails, the array needs
to be freed, so we are not taking this into the ceph tree either ;)

Thanks,

                Ilya
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help