* [PATCH 1/1] rds: fix memory leak error
@ 2017-02-24 9:28 Zhu Yanjun
[not found] ` <1487928481-1022-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Zhu Yanjun @ 2017-02-24 9:28 UTC (permalink / raw)
To: santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA,
davem-fT/PcQaiUtIeIZ0/mPfg9Q, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
rds-devel-N0ozoZBvEnrZJqsBc5GL+g
When the function register_netdevice_notifier fails, the memory
allocated by kmem_cache_create should be freed by the function
kmem_cache_destroy.
Cc: Joe Jin <joe.jin-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: Junxiao Bi <junxiao.bi-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Zhu Yanjun <yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
net/rds/tcp.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index 57bb523..5438f67 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
@@ -641,12 +641,12 @@ static int rds_tcp_init(void)
ret = register_netdevice_notifier(&rds_tcp_dev_notifier);
if (ret) {
pr_warn("could not register rds_tcp_dev_notifier\n");
- goto out;
+ goto out_slab;
}
ret = register_pernet_subsys(&rds_tcp_net_ops);
if (ret)
- goto out_slab;
+ goto out_notifier;
ret = rds_tcp_recv_init();
if (ret)
@@ -664,9 +664,10 @@ static int rds_tcp_init(void)
rds_tcp_recv_exit();
out_pernet:
unregister_pernet_subsys(&rds_tcp_net_ops);
-out_slab:
+out_notifier:
if (unregister_netdevice_notifier(&rds_tcp_dev_notifier))
pr_warn("could not unregister rds_tcp_dev_notifier\n");
+out_slab:
kmem_cache_destroy(rds_tcp_conn_slab);
out:
return ret;
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] rds: fix memory leak error
[not found] ` <1487928481-1022-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2017-02-24 16:49 ` Santosh Shilimkar
[not found] ` <79081f83-c9ed-5e45-ecbb-754fe1c9a96a-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-02-24 17:21 ` sowmini
2017-02-24 19:13 ` David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Santosh Shilimkar @ 2017-02-24 16:49 UTC (permalink / raw)
To: Zhu Yanjun, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
rds-devel-N0ozoZBvEnrZJqsBc5GL+g
On 2/24/2017 1:28 AM, Zhu Yanjun wrote:
> When the function register_netdevice_notifier fails, the memory
> allocated by kmem_cache_create should be freed by the function
> kmem_cache_destroy.
>
> Cc: Joe Jin <joe.jin-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Cc: Junxiao Bi <junxiao.bi-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Zhu Yanjun <yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> ---
Minor nit with subject.
s/rds/RDS: TCP:
patch looks fine to me.
Acked:by: Santosh Shilimkar <santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] rds: fix memory leak error
[not found] ` <1487928481-1022-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-02-24 16:49 ` Santosh Shilimkar
@ 2017-02-24 17:21 ` sowmini
2017-02-24 19:13 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: sowmini @ 2017-02-24 17:21 UTC (permalink / raw)
To: Zhu Yanjun, santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA,
davem-fT/PcQaiUtIeIZ0/mPfg9Q, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
rds-devel-N0ozoZBvEnrZJqsBc5GL+g
On 02/24/2017 04:28 AM, Zhu Yanjun wrote:
> When the function register_netdevice_notifier fails, the memory
> allocated by kmem_cache_create should be freed by the function
> kmem_cache_destroy.
>
> Cc: Joe Jin <joe.jin-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Cc: Junxiao Bi <junxiao.bi-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Zhu Yanjun <yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Acked-by: Sowmini Varadhan <sowmini.varadhan-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] rds: fix memory leak error
[not found] ` <79081f83-c9ed-5e45-ecbb-754fe1c9a96a-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2017-02-24 19:12 ` David Miller
2017-02-24 19:20 ` santosh.shilimkar
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2017-02-24 19:12 UTC (permalink / raw)
To: santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA
Cc: yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
rds-devel-N0ozoZBvEnrZJqsBc5GL+g
From: Santosh Shilimkar <santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Date: Fri, 24 Feb 2017 08:49:19 -0800
> On 2/24/2017 1:28 AM, Zhu Yanjun wrote:
>> When the function register_netdevice_notifier fails, the memory
>> allocated by kmem_cache_create should be freed by the function
>> kmem_cache_destroy.
>>
>> Cc: Joe Jin <joe.jin-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
>> Cc: Junxiao Bi <junxiao.bi-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
>> Signed-off-by: Zhu Yanjun <yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
>> ---
> Minor nit with subject.
> s/rds/RDS: TCP:
Please, I definitely prefer people use all lowercase letters for
the susbsystem prefix in the subject line.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] rds: fix memory leak error
[not found] ` <1487928481-1022-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-02-24 16:49 ` Santosh Shilimkar
2017-02-24 17:21 ` sowmini
@ 2017-02-24 19:13 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-02-24 19:13 UTC (permalink / raw)
To: yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA
Cc: santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
rds-devel-N0ozoZBvEnrZJqsBc5GL+g
From: Zhu Yanjun <yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Date: Fri, 24 Feb 2017 04:28:01 -0500
> When the function register_netdevice_notifier fails, the memory
> allocated by kmem_cache_create should be freed by the function
> kmem_cache_destroy.
>
> Cc: Joe Jin <joe.jin-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Cc: Junxiao Bi <junxiao.bi-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Zhu Yanjun <yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Applied, thank you.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] rds: fix memory leak error
2017-02-24 19:12 ` David Miller
@ 2017-02-24 19:20 ` santosh.shilimkar
0 siblings, 0 replies; 6+ messages in thread
From: santosh.shilimkar @ 2017-02-24 19:20 UTC (permalink / raw)
To: David Miller; +Cc: yanjun.zhu, netdev, linux-rdma, rds-devel
On 2/24/17 11:12 AM, David Miller wrote:
> From: Santosh Shilimkar <santosh.shilimkar@oracle.com>
> Date: Fri, 24 Feb 2017 08:49:19 -0800
>
>> On 2/24/2017 1:28 AM, Zhu Yanjun wrote:
>>> When the function register_netdevice_notifier fails, the memory
>>> allocated by kmem_cache_create should be freed by the function
>>> kmem_cache_destroy.
>>>
>>> Cc: Joe Jin <joe.jin@oracle.com>
>>> Cc: Junxiao Bi <junxiao.bi@oracle.com>
>>> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
>>> ---
>> Minor nit with subject.
>> s/rds/RDS: TCP:
>
> Please, I definitely prefer people use all lowercase letters for
> the susbsystem prefix in the subject line.
>
Note for the future. Thanks Dave !!
Regards,
Santosh
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-02-24 19:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-24 9:28 [PATCH 1/1] rds: fix memory leak error Zhu Yanjun
[not found] ` <1487928481-1022-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-02-24 16:49 ` Santosh Shilimkar
[not found] ` <79081f83-c9ed-5e45-ecbb-754fe1c9a96a-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-02-24 19:12 ` David Miller
2017-02-24 19:20 ` santosh.shilimkar
2017-02-24 17:21 ` sowmini
2017-02-24 19:13 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).