LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [PATCH net v2] ipvs: fix possible memory leak in ip_vs_control_net_i

To: Julian Anastasov <ja@xxxxxx>
Subject: Re: [PATCH net v2] ipvs: fix possible memory leak in ip_vs_control_net_init
Cc: Simon Horman <horms@xxxxxxxxxxxx>, <pablo@xxxxxxxxxxxxx>, <christian@xxxxxxxxxx>, <lvs-devel@xxxxxxxxxxxxxxx>, <netfilter-devel@xxxxxxxxxxxxxxx>
From: "wanghai (M)" <wanghai38@xxxxxxxxxx>
Date: Tue, 24 Nov 2020 16:07:00 +0800

在 2020/11/24 3:04, Julian Anastasov 写道:
        Hello,

On Mon, 23 Nov 2020, wanghai (M) wrote:

在 2020/11/22 19:20, Julian Anastasov 写道:
  Hello,

On Fri, 20 Nov 2020, Wang Hai wrote:

+       if (!proc_create_net_single("ip_vs_stats_percpu", 0,
ipvs->net->proc_net,
+                       ip_vs_stats_percpu_show, NULL))
+               goto err_percpu;
        Make sure the parameters are properly aligned to function open
parenthesis without exceeding 80 columns:

linux# scripts/checkpatch.pl --strict /tmp/file.patch
Thanks, I'll perfect it.
        It was true only for first call due to some
renames for the others two in commit 3617d9496cd9 :(
It does indeed rename in commit 3617d9496cd9.
But I don't understand what's wrong with my patch here.
        Visually, they should look like this:

         if (!proc_create_net("ip_vs", 0, ipvs->net->proc_net,
                              &ip_vs_info_seq_ops, sizeof(struct ip_vs_iter)))
                 goto err_vs;
         if (!proc_create_net_single("ip_vs_stats", 0, ipvs->net->proc_net,
                                     ip_vs_stats_show, NULL))
                 goto err_stats;
         if (!proc_create_net_single("ip_vs_stats_percpu", 0,
                                     ipvs->net->proc_net,
                                     ip_vs_stats_percpu_show, NULL))
                 goto err_percpu;

Thank you for your patient explanation, I got it.

I just sent v3

"[PATCH net v3] ipvs: fix possible memory leak in ip_vs_control_net_init"

        The first one explained:

<1  TAB>if (!proc_create_net("ip_vs", 0, ipvs->net->proc_net,
<  open parenthesis is here  ^ and all next lines align to first parameter>
<1  TAB><1  TAB><1 TAB><5 SP>&ip_vs_info_seq_ops, sizeof(struct ip_vs_iter)))
<1  TAB><1  TAB>goto err_vs;

Regards

--
Julian Anastasov <ja@xxxxxx>

<Prev in Thread] Current Thread [Next in Thread>