Message ID | 20201216130239.13759-1-zhengyongjun3@huawei.com (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] ceph: Delete useless kfree code | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 7 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
netdev/stable | success | Stable not CCed |
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 <zhengyongjun3@huawei.com> To be clear the subject tags is misleading we're not taking this into the networking tree, ceph folk please go ahead :)
On Thu, Dec 17, 2020 at 2:25 AM Jakub Kicinski <kuba@kernel.org> wrote: > > 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 <zhengyongjun3@huawei.com> > > 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
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); }
The parameter of kfree function is NULL, so kfree code is useless, delete it. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> --- net/ceph/osdmap.c | 1 - 1 file changed, 1 deletion(-)