From patchwork Mon May 22 14:13:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9740609 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 25373601C2 for ; Mon, 22 May 2017 14:13:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15A9728699 for ; Mon, 22 May 2017 14:13:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A38B286BA; Mon, 22 May 2017 14:13:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEAA228699 for ; Mon, 22 May 2017 14:13:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934152AbdEVON3 (ORCPT ); Mon, 22 May 2017 10:13:29 -0400 Received: from mout.web.de ([212.227.15.3]:57824 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933734AbdEVON2 (ORCPT ); Mon, 22 May 2017 10:13:28 -0400 Received: from [192.168.1.2] ([78.49.33.162]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M0yzv-1e6R2U1Ehr-00v44j; Mon, 22 May 2017 16:13:13 +0200 Subject: [PATCH 3/3] RDS: TCP: Delete an error message for a failed memory allocation in rds_tcp_init_net() From: SF Markus Elfring To: linux-rdma@vger.kernel.org, netdev@vger.kernel.org, rds-devel@oss.oracle.com, "David S. Miller" , Santosh Shilimkar , Sowmini Varadhan Cc: LKML , kernel-janitors@vger.kernel.org References: <44b46c51-3665-5f14-dd3b-6e6f230258a7@users.sourceforge.net> Message-ID: <5d523cf8-1540-e704-2301-a5e0205cb536@users.sourceforge.net> Date: Mon, 22 May 2017 16:13:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <44b46c51-3665-5f14-dd3b-6e6f230258a7@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:wOu348RCS2XTIQwkHhHaF7dvFQ6HpeuT7DiEUD8UpSVAKtLXzZa Il9w7U+angQJnlz5WJgNsFDWvc6mFSAPZEh4GFJenWLO/iwRfnlPvo2wY1UCYI8wjfN9K5n RMI4XlsCfD8LJcWp2X8+VwvgYu282oMhU4fr9TN/+aNKpOc+Zj2W1Y89+VzzzetyFLkQeU5 NEG6jndi2mzTacOuNJprw== X-UI-Out-Filterresults: notjunk:1; V01:K0:fIx8XV7Ok6g=:+9ZxsYKkFiSGNEtEdv5hvZ cZv+TtH86CaM1VYc8sjljsk0GZbpP+kTZ5Xw9iVw0xvTc91tZ89K5D5Jx6Y+tPoFvug8rG6Rb o4LsQUEQcNK/WEPZJLZwKBkbjqs3iizph6GiJCXkBo/V5NK54IMUX1cnHVrysTS2s763VZt76 SdGnDqR26aby2QZ4YOGJdLXUzh2kFFyPNmmil9zb/OhPI4FqFTc72e4u5zixYMxQPBJDKGHnR /NTvR5YGtsB7POqlk+TGBm8JEGKy1IXroStl4xKdSex4ygx1fGCc9dZC6pLakGHAsHdFNHOCt NtvUqxq9oaeoYAdURWk7hvKCthCzpbxZ9t6X3JPT3pb8VDKRQz/RDL9s7Nwb4xT4NW0ATAcvM stZUCC5y5Fsi8eyqWj/eqKBuqAPEOp5wtmUhEmbpK8NbPG8N0s528S5U1OGv8ZyrpmAvVXFdi Ty2maTuC7sx+WlVmwvM+3UyozyWZYSfDzP13nXvdikeIrnRNBBB3RjjVvBYzFVu4E2lX5iqj1 Khn9BsQE2DxersHNRxLOLNUBDN25+W+00JL2EL4f2SXvDKYoKyNDmi5/cNiMBWC5B/5TbI0z7 rSMK0lVzuweGsrOKI+7tM/rDxcZcb4FAKXflT4NgKkI6BxK5EW+ULHcE3GyOT38O5YYxmaE08 yO71l0w9EG2ApIbgpmMzMJDX4SuWIEy3o19RAlO8TRHQ/ML4F+BP4jv/Otzj5xKJQ6LqXIOz0 FUgKpiJEh/pxdw2IX3XcUIdG8azD3IOhapQzKX72CcawM97pD4PXGPLZXnPt3UY7x3nWzCc20 1VX3ST8 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring 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 Acked-by: Sowmini Varadhan --- net/rds/tcp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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;