diff mbox

[3/3] RDS: TCP: Delete an error message for a failed memory allocation in rds_tcp_init_net()

Message ID 5d523cf8-1540-e704-2301-a5e0205cb536@users.sourceforge.net
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

SF Markus Elfring May 22, 2017, 2:13 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 22 May 2017 15:45:31 +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/rds/tcp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Sowmini Varadhan May 22, 2017, 2:26 p.m. UTC | #1
On (05/22/17 16:13), SF Markus Elfring wrote:
> 
> Omit an extra message for a memory allocation failure in this function.

The change itself is harmless,  but I'm curious about the "extra"
part: "extra" from what? If this happens, hopefully this will be logged
somewhere? Note that this type of (infrequent) logging noise is useful
in some cases, e.g., with 8ce675ff, when one is trying to do the
post-mortem of where things first went wrong.

--Sowmini
SF Markus Elfring May 22, 2017, 2:32 p.m. UTC | #2
>> Omit an extra message for a memory allocation failure in this function.
> 
> The change itself is harmless,  but I'm curious about the "extra"
> part: "extra" from what? If this happens, hopefully this will be logged
> somewhere? Note that this type of (infrequent) logging noise is useful
> in some cases, e.g., with 8ce675ff, when one is trying to do the
> post-mortem of where things first went wrong.

Do you find information from a Linux allocation failure report sufficient
for such an use case?

Regards,
Markus
Sowmini Varadhan May 22, 2017, 2:46 p.m. UTC | #3
> Do you find information from a Linux allocation failure report sufficient
> for such an use case?

yes, I suppose that would cover the needed cases. 
Your change looks good to me.

Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
diff mbox

Patch

diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index 431404dbdad1..b0348697dee5 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
@@ -431,10 +431,9 @@  static __net_init int rds_tcp_init_net(struct net *net)
 	} else {
 		tbl = kmemdup(rds_tcp_sysctl_table,
 			      sizeof(rds_tcp_sysctl_table), GFP_KERNEL);
-		if (!tbl) {
-			pr_warn("could not set allocate syctl table\n");
+		if (!tbl)
 			return -ENOMEM;
-		}
+
 		rtn->ctl_table = tbl;
 	}
 	tbl[RDS_TCP_SNDBUF].data = &rtn->sndbuf_size;