2019-05-16 15:24:47

by George G. Davis

[permalink] [raw]
Subject: [PATCH] net: sysctl: cleanup net_sysctl_init error exit paths

Unwind net_sysctl_init error exit goto spaghetti code

Suggested-by: Joshua Frkuska <[email protected]>
Signed-off-by: George G. Davis <[email protected]>
---
net/sysctl_net.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index 9aed6fe1bf1a..7710a2d7f79a 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -104,14 +104,12 @@ __init int net_sysctl_init(void)
if (!net_header)
goto out;
ret = register_pernet_subsys(&sysctl_pernet_ops);
- if (ret)
- goto out1;
-out:
- return ret;
-out1:
+ if (!ret)
+ goto out;
unregister_sysctl_table(net_header);
net_header = NULL;
- goto out;
+out:
+ return ret;
}

struct ctl_table_header *register_net_sysctl(struct net *net,
--
2.7.4


2019-05-16 22:35:09

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] net: sysctl: cleanup net_sysctl_init error exit paths

From: "George G. Davis" <[email protected]>
Date: Thu, 16 May 2019 11:23:08 -0400

> Unwind net_sysctl_init error exit goto spaghetti code
>
> Suggested-by: Joshua Frkuska <[email protected]>
> Signed-off-by: George G. Davis <[email protected]>

Cleanups are not appropriate until the net-next tree opens back up.

So please resubmit at that time.

Thank you.

2019-05-17 16:03:09

by George G. Davis

[permalink] [raw]
Subject: Re: [PATCH] net: sysctl: cleanup net_sysctl_init error exit paths

Hello David,

On Thu, May 16, 2019 at 02:27:44PM -0700, David Miller wrote:
> From: "George G. Davis" <[email protected]>
> Date: Thu, 16 May 2019 11:23:08 -0400
>
> > Unwind net_sysctl_init error exit goto spaghetti code
> >
> > Suggested-by: Joshua Frkuska <[email protected]>
> > Signed-off-by: George G. Davis <[email protected]>
>
> Cleanups are not appropriate until the net-next tree opens back up.
>
> So please resubmit at that time.

I fear that I may be distracted by other shiny objects by then but
I'll make a reminder and try to resubmit during the next merge window.

Thanks!

>
> Thank you.

--
Regards,
George

2019-07-08 23:41:14

by George G. Davis

[permalink] [raw]
Subject: Re: [PATCH] net: sysctl: cleanup net_sysctl_init error exit paths

Hello David,

On Fri, May 17, 2019 at 10:43:45AM -0400, George G. Davis wrote:
> Hello David,
>
> On Thu, May 16, 2019 at 02:27:44PM -0700, David Miller wrote:
> > From: "George G. Davis" <[email protected]>
> > Date: Thu, 16 May 2019 11:23:08 -0400
> >
> > > Unwind net_sysctl_init error exit goto spaghetti code
> > >
> > > Suggested-by: Joshua Frkuska <[email protected]>
> > > Signed-off-by: George G. Davis <[email protected]>
> >
> > Cleanups are not appropriate until the net-next tree opens back up.
> >
> > So please resubmit at that time.
>
> I fear that I may be distracted by other shiny objects by then but
> I'll make a reminder and try to resubmit during the next merge window.

Since the "Linux 5.2" kernel has been released [1], I'm guessing that the
net-next merge window is open now? If yes, the patch remains unchanged
since my initial post. Please consider applying or let me know when to
resubmit when the net-next merge window is again open.

TIA!


>
> Thanks!
>
> >
> > Thank you.
>
> --
> Regards,
> George

--
Regards,
George
[1] https://lwn.net/Articles/792995/

2019-09-17 18:21:16

by George G. Davis

[permalink] [raw]
Subject: Re: [PATCH] net: sysctl: cleanup net_sysctl_init error exit paths

Hello David,

On Mon, Jul 08, 2019 at 06:47:32PM -0400, George G. Davis wrote:
> Hello David,
>
> On Fri, May 17, 2019 at 10:43:45AM -0400, George G. Davis wrote:
> > Hello David,
> >
> > On Thu, May 16, 2019 at 02:27:44PM -0700, David Miller wrote:
> > > From: "George G. Davis" <[email protected]>
> > > Date: Thu, 16 May 2019 11:23:08 -0400
> > >
> > > > Unwind net_sysctl_init error exit goto spaghetti code
> > > >
> > > > Suggested-by: Joshua Frkuska <[email protected]>
> > > > Signed-off-by: George G. Davis <[email protected]>
> > >
> > > Cleanups are not appropriate until the net-next tree opens back up.
> > >
> > > So please resubmit at that time.
> >
> > I fear that I may be distracted by other shiny objects by then but
> > I'll make a reminder and try to resubmit during the next merge window.
>
> Since the "Linux 5.2" kernel has been released [1], I'm guessing that the
> net-next merge window is open now? If yes, the patch remains unchanged
> since my initial post. Please consider applying or let me know when to
> resubmit when the net-next merge window is again open.

Ping, "Linux 5.3" kernel has been released [1] and it appears that the
5.4 merge window is open. The patch [2] remains unchanged since my initial
post. Please consider applying it.

Thanks!

--
Regards,
George
[1] https://lwn.net/Articles/799250/
[2] https://lore.kernel.org/patchwork/patch/1074969/

2019-09-18 09:51:06

by Nicolas Dichtel

[permalink] [raw]
Subject: Re: [PATCH] net: sysctl: cleanup net_sysctl_init error exit paths

Le 17/09/2019 à 17:53, George G. Davis a écrit :
[snip]
> Ping, "Linux 5.3" kernel has been released [1] and it appears that the
> 5.4 merge window is open. The patch [2] remains unchanged since my initial
> post. Please consider applying it.

net-next is closed:
http://vger.kernel.org/~davem/net-next.html

You will have to resend the patch when net-next opens.

2019-09-18 17:24:42

by George G. Davis

[permalink] [raw]
Subject: Re: [PATCH] net: sysctl: cleanup net_sysctl_init error exit paths

Hello Nicolas,

On Wed, Sep 18, 2019 at 11:44:55AM +0200, Nicolas Dichtel wrote:
> Le 17/09/2019 ? 17:53, George G. Davis a ?crit?:
> [snip]
> > Ping, "Linux 5.3" kernel has been released [1] and it appears that the
> > 5.4 merge window is open. The patch [2] remains unchanged since my initial
> > post. Please consider applying it.
>
> net-next is closed:
> http://vger.kernel.org/~davem/net-next.html
>
> You will have to resend the patch when net-next opens.

Thanks! I'll watch for the "net-next is OPEN" announcment and resubmit then.

--
Regards,
George