All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Neil Horman <nhorman@tuxdriver.com>,
	Vlad Yasevich <vyasevich@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/5] sctp: Delete an error message for a failed memory allocation in sctp_init()
Date: Mon, 22 May 2017 16:56:58 +0000	[thread overview]
Message-ID: <20170522165658.GA4642@localhost.localdomain> (raw)
In-Reply-To: <7db0cb49-109b-88a6-532f-c591cc8ffa85@users.sourceforge.net>

On Mon, May 22, 2017 at 06:38:21PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 22 May 2017 17:28:14 +0200
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  net/sctp/protocol.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
> index 2b1a6215bd2f..5e7c8a344770 100644
> --- a/net/sctp/protocol.c
> +++ b/net/sctp/protocol.c
> @@ -1447,5 +1447,4 @@ static __init int sctp_init(void)
>  	if (!sctp_ep_hashtable) {
> -		pr_err("Failed endpoint_hash alloc\n");

Okay but then why not also delete the one a few lines below this one:
        if (!sctp_port_hashtable) {
                pr_err("Failed bind hash alloc\n");
                status = -ENOMEM;
                goto err_bhash_alloc;
        }
Seems the same pattern to me.

>  		status = -ENOMEM;
>  		goto err_ehash_alloc;
>  	}
> -- 
> 2.13.0
> 
> --
> 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
> 

WARNING: multiple messages have this Message-ID (diff)
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Neil Horman <nhorman@tuxdriver.com>,
	Vlad Yasevich <vyasevich@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/5] sctp: Delete an error message for a failed memory allocation in sctp_init()
Date: Mon, 22 May 2017 13:56:58 -0300	[thread overview]
Message-ID: <20170522165658.GA4642@localhost.localdomain> (raw)
In-Reply-To: <7db0cb49-109b-88a6-532f-c591cc8ffa85@users.sourceforge.net>

On Mon, May 22, 2017 at 06:38:21PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 22 May 2017 17:28:14 +0200
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  net/sctp/protocol.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
> index 2b1a6215bd2f..5e7c8a344770 100644
> --- a/net/sctp/protocol.c
> +++ b/net/sctp/protocol.c
> @@ -1447,5 +1447,4 @@ static __init int sctp_init(void)
>  	if (!sctp_ep_hashtable) {
> -		pr_err("Failed endpoint_hash alloc\n");

Okay but then why not also delete the one a few lines below this one:
        if (!sctp_port_hashtable) {
                pr_err("Failed bind hash alloc\n");
                status = -ENOMEM;
                goto err_bhash_alloc;
        }
Seems the same pattern to me.

>  		status = -ENOMEM;
>  		goto err_ehash_alloc;
>  	}
> -- 
> 2.13.0
> 
> --
> 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
> 

  reply	other threads:[~2017-05-22 16:56 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22 16:35 [PATCH 0/5] net-SCTP: Adjustments for three function implementations SF Markus Elfring
2017-05-22 16:35 ` SF Markus Elfring
2017-05-22 16:37 ` [PATCH 1/5] sctp: Use kmalloc_array() in sctp_init() SF Markus Elfring
2017-05-22 16:37   ` SF Markus Elfring
2017-05-22 19:51   ` Marcelo Ricardo Leitner
2017-05-22 19:51     ` Marcelo Ricardo Leitner
2017-05-22 20:57   ` Vlad Yasevich
2017-05-22 20:57     ` Vlad Yasevich
2017-05-22 16:38 ` [PATCH 2/5] sctp: Delete an error message for a failed memory allocation " SF Markus Elfring
2017-05-22 16:38   ` SF Markus Elfring
2017-05-22 16:56   ` Marcelo Ricardo Leitner [this message]
2017-05-22 16:56     ` Marcelo Ricardo Leitner
2017-05-22 19:46     ` SF Markus Elfring
2017-05-22 19:46       ` SF Markus Elfring
2017-05-22 19:50       ` Marcelo Ricardo Leitner
2017-05-22 19:50         ` Marcelo Ricardo Leitner
2017-05-22 19:52   ` Marcelo Ricardo Leitner
2017-05-22 19:52     ` Marcelo Ricardo Leitner
2017-05-22 20:59   ` Vlad Yasevich
2017-05-22 20:59     ` Vlad Yasevich
2017-05-22 16:39 ` [PATCH 3/5] sctp: Fix a typo in a comment line " SF Markus Elfring
2017-05-22 16:39   ` SF Markus Elfring
2017-05-22 19:52   ` Marcelo Ricardo Leitner
2017-05-22 19:52     ` Marcelo Ricardo Leitner
2017-05-22 21:00   ` Vlad Yasevich
2017-05-22 21:00     ` Vlad Yasevich
2017-05-22 16:40 ` [PATCH 4/5] sctp: Improve a size determination in sctp_inetaddr_event() SF Markus Elfring
2017-05-22 16:40   ` SF Markus Elfring
2017-05-22 19:52   ` Marcelo Ricardo Leitner
2017-05-22 19:52     ` Marcelo Ricardo Leitner
2017-05-22 21:00   ` Vlad Yasevich
2017-05-22 21:00     ` Vlad Yasevich
2017-05-22 16:41 ` [PATCH 5/5] sctp: Adjust one function call together with a variable assignment SF Markus Elfring
2017-05-22 16:41   ` SF Markus Elfring
2017-05-22 19:53   ` Marcelo Ricardo Leitner
2017-05-22 19:53     ` Marcelo Ricardo Leitner
2017-05-22 21:00   ` Vlad Yasevich
2017-05-22 21:00     ` Vlad Yasevich
2017-05-23  6:34 ` [PATCH 0/5] net-SCTP: Adjustments for three function implementations Xin Long
2017-05-23  6:34   ` Xin Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170522165658.GA4642@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=davem@davemloft.net \
    --cc=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=vyasevich@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.