diff mbox

[-next] sctp: fix error return code in sctp_init()

Message ID 1465830506-22752-1-git-send-email-weiyj_lk@163.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

weiyj_lk@163.com June 13, 2016, 3:08 p.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 net/sctp/protocol.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Xin Long June 14, 2016, 3:04 a.m. UTC | #1
On Mon, Jun 13, 2016 at 11:08 PM,  <weiyj_lk@163.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  net/sctp/protocol.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
> index 40022ee..3b56ae5 100644
> --- a/net/sctp/protocol.c
> +++ b/net/sctp/protocol.c
> @@ -1479,7 +1479,8 @@ static __init int sctp_init(void)
>                 INIT_HLIST_HEAD(&sctp_port_hashtable[i].chain);
>         }
>
> -       if (sctp_transport_hashtable_init())
> +       status = sctp_transport_hashtable_init();
> +       if (status)
>                 goto err_thash_alloc;
>
>         pr_info("Hash tables configured (bind %d/%d)\n", sctp_port_hashsize,
>
>
Acked-by: Xin Long <lucien.xin@gmail.com>
Neil Horman June 14, 2016, 1:21 p.m. UTC | #2
On Tue, Jun 14, 2016 at 11:04:05AM +0800, Xin Long wrote:
> On Mon, Jun 13, 2016 at 11:08 PM,  <weiyj_lk@163.com> wrote:
> > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> >
> > Fix to return a negative error code from the error handling
> > case instead of 0, as done elsewhere in this function.
> >
> > Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> > ---
> >  net/sctp/protocol.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
> > index 40022ee..3b56ae5 100644
> > --- a/net/sctp/protocol.c
> > +++ b/net/sctp/protocol.c
> > @@ -1479,7 +1479,8 @@ static __init int sctp_init(void)
> >                 INIT_HLIST_HEAD(&sctp_port_hashtable[i].chain);
> >         }
> >
> > -       if (sctp_transport_hashtable_init())
> > +       status = sctp_transport_hashtable_init();
> > +       if (status)
> >                 goto err_thash_alloc;
> >
> >         pr_info("Hash tables configured (bind %d/%d)\n", sctp_port_hashsize,
> >
> >
> Acked-by: Xin Long <lucien.xin@gmail.com>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Acked-by: Neil Horman <nhorman@tuxdriver.com>
David Miller June 15, 2016, 6:46 a.m. UTC | #3
From: weiyj_lk@163.com
Date: Mon, 13 Jun 2016 23:08:26 +0800

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied.
diff mbox

Patch

diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 40022ee..3b56ae5 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1479,7 +1479,8 @@  static __init int sctp_init(void)
 		INIT_HLIST_HEAD(&sctp_port_hashtable[i].chain);
 	}
 
-	if (sctp_transport_hashtable_init())
+	status = sctp_transport_hashtable_init();
+	if (status)
 		goto err_thash_alloc;
 
 	pr_info("Hash tables configured (bind %d/%d)\n", sctp_port_hashsize,