diff mbox

[net-next,1/2] 6lowpan: reassembly: fix return of init function

Message ID 1394052211-6976-2-git-send-email-alex.aring@gmail.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Alexander Aring March 5, 2014, 8:43 p.m. UTC
This patch adds a missing return after fragmentation init. Otherwise we
register a sysctl interface and deregister it afterwards which makes no
sense.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 net/ieee802154/reassembly.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Sergei Shtylyov March 5, 2014, 10:04 p.m. UTC | #1
Hello.

On 03/05/2014 11:43 PM, Alexander Aring wrote:

> This patch adds a missing return after fragmentation init. Otherwise we
> register a sysctl interface and deregister it afterwards which makes no
> sense.

> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
>   net/ieee802154/reassembly.c | 2 ++
>   1 file changed, 2 insertions(+)

> diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c
> index 4511fc2..59db7b5 100644
> --- a/net/ieee802154/reassembly.c
> +++ b/net/ieee802154/reassembly.c
> @@ -550,6 +550,8 @@ int __init lowpan_net_frag_init(void)
>   	lowpan_frags.frag_expire = lowpan_frag_expire;
>   	lowpan_frags.secret_interval = 10 * 60 * HZ;
>   	inet_frags_init(&lowpan_frags);
> +
> +	return 0;

    Perhaps 'goto out' for "consistency" with the code above? (I don't know 
why they used "goto out' in the first place.)

>   err_pernet:
>   	lowpan_frags_sysctl_unregister();
>   out:

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexander Aring March 6, 2014, 5:44 a.m. UTC | #2
Hi Sergei,

On Thu, Mar 06, 2014 at 01:04:20AM +0300, Sergei Shtylyov wrote:
> Hello.
> 
> On 03/05/2014 11:43 PM, Alexander Aring wrote:
> 
> >This patch adds a missing return after fragmentation init. Otherwise we
> >register a sysctl interface and deregister it afterwards which makes no
> >sense.
> 
> >Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> >---
> >  net/ieee802154/reassembly.c | 2 ++
> >  1 file changed, 2 insertions(+)
> 
> >diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c
> >index 4511fc2..59db7b5 100644
> >--- a/net/ieee802154/reassembly.c
> >+++ b/net/ieee802154/reassembly.c
> >@@ -550,6 +550,8 @@ int __init lowpan_net_frag_init(void)
> >  	lowpan_frags.frag_expire = lowpan_frag_expire;
> >  	lowpan_frags.secret_interval = 10 * 60 * HZ;
> >  	inet_frags_init(&lowpan_frags);
> >+
> >+	return 0;
> 
>    Perhaps 'goto out' for "consistency" with the code above? (I don't know
> why they used "goto out' in the first place.)
> 
ok, thanks, I will remove the "goto out" and will replace it with a
"return 0" if you are fine with that.

- Alex
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov March 6, 2014, 1:30 p.m. UTC | #3
Hello.

On 06-03-2014 9:44, Alexander Aring wrote:

>>> This patch adds a missing return after fragmentation init. Otherwise we
>>> register a sysctl interface and deregister it afterwards which makes no
>>> sense.

>>> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
>>> ---
>>>   net/ieee802154/reassembly.c | 2 ++
>>>   1 file changed, 2 insertions(+)
>>
>>> diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c
>>> index 4511fc2..59db7b5 100644
>>> --- a/net/ieee802154/reassembly.c
>>> +++ b/net/ieee802154/reassembly.c
>>> @@ -550,6 +550,8 @@ int __init lowpan_net_frag_init(void)
>>>   	lowpan_frags.frag_expire = lowpan_frag_expire;
>>>   	lowpan_frags.secret_interval = 10 * 60 * HZ;
>>>   	inet_frags_init(&lowpan_frags);
>>> +
>>> +	return 0;

>>     Perhaps 'goto out' for "consistency" with the code above? (I don't know
>> why they used "goto out' in the first place.)

> ok, thanks, I will remove the "goto out" and will replace it with a
> "return 0" if you are fine with that.

    You can't replace it with "return 0", only with "return ret".

> - Alex

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c
index 4511fc2..59db7b5 100644
--- a/net/ieee802154/reassembly.c
+++ b/net/ieee802154/reassembly.c
@@ -550,6 +550,8 @@  int __init lowpan_net_frag_init(void)
 	lowpan_frags.frag_expire = lowpan_frag_expire;
 	lowpan_frags.secret_interval = 10 * 60 * HZ;
 	inet_frags_init(&lowpan_frags);
+
+	return 0;
 err_pernet:
 	lowpan_frags_sysctl_unregister();
 out: