From patchwork Mon May 22 14:11:37 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: 9740593 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 9BEE0601C2 for ; Mon, 22 May 2017 14:12:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C2C6284F3 for ; Mon, 22 May 2017 14:12:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80F9528697; Mon, 22 May 2017 14:12:15 +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 33845284F3 for ; Mon, 22 May 2017 14:12:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934384AbdEVOL5 (ORCPT ); Mon, 22 May 2017 10:11:57 -0400 Received: from mout.web.de ([212.227.15.3]:58602 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933734AbdEVOLy (ORCPT ); Mon, 22 May 2017 10:11:54 -0400 Received: from [192.168.1.2] ([78.49.33.162]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M2unu-1e3x8s0gL8-00sb1i; Mon, 22 May 2017 16:11:40 +0200 Subject: [PATCH 1/3] RDS: IB: Delete an error message for a failed memory allocation in rds_ib_add_one() 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: Date: Mon, 22 May 2017 16:11:37 +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:6Ufhg0fwGR85DFmWkXj7Qg7JHpiFGky63wkSOmhSyAxJpCxzLkF UEkGa5NpDeMk0wXGKO3uXDlMYeK+EkziSM7c8tmZ0JbSenPmtzUOshPUxIl/og3IemKvQSF XyDUR8Wdi9dQ/MHAVSJGTOQMBP5fDbMU/uic72tEvlE0vgU/C92xiAV7WhfQzZ8W6t8Fpp5 ZIiomIPD8VmJAjROEbRzg== X-UI-Out-Filterresults: notjunk:1; V01:K0:ujqK/eDeyI0=:q6R/JgXLxM4zOm/yYjZVuv 9yL05ZEaW6KV4bOWDhPOQhopMqhdSeOJ0G9GT61XKCijfmaBHbutWJGa+ni3nh5cH2XQPdEZt T9yrhGVF9kKqIqIwI4dG5Xmh2cA3896BSPfVcMz3jxKQkoAo3Nj6jF1ZLG4j1S8Ex9rXCkQHl eC00+Djrof4kOtLJq2k1DT/8w/mvzz+cgz1cFBNI+F3SKa9iaZUM9HiNxw/3ZUTDwz/9sLY3m /8cAT2KOrKpoGucVOHdLu9xln3oSuK20XtIWr25IIikbUx5EiIz7BKtR8S8P1nfYYPWjbOnxv LSvCCghcyW4zgHJScFT3Qifz2GCyqTBLBIdf94xpy1mMcnoa6zU7jWLDWsYjnVknO49BXlRzS pp8QqzbdoeINa6rWqKdlYs35zKCkhPegmTrEHqXqYAi/eqs//7dZufWp4OfsuxUZgsHJwNeU2 Qg8urZJesRTYDFbK2/OKjrFhcuL41QTV3PCXQDoai0nBdcI1152fWnZtTFgA5KsqAM7oNmmX8 TMNzcwB5aiFp5r1D+We+F6HfD/H5c43zNAvQ2MWTzzSM5CC+ZjdxNZtfQ2iLYqHHg8dEVpq1D sawHqf9v5h4mNTruJt9uqGxkjeClO8lsWviY3G+q1FSIj7Me0iBwEKxcSGuTHsfVAWn8CtLwS uC1hf+ZpgaSYfqnyOI3xsF1zpDl6HDeNrmLMZG8jtMzabrtu9ydWi/KxRi0i8ehtB+wue8bvn LFNU0yuWVzO/3L5mNKbOlY/S6AiX6NT40M9AHkEokB4lXT8pLNyxCY0ISLnB9UKHZyL9PXc+d OFCP32S 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:34:28 +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: Santosh Shilimkar --- net/rds/ib.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/rds/ib.c b/net/rds/ib.c index 7a64c8db81ab..c5514d058171 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -166,8 +166,5 @@ static void rds_ib_add_one(struct ib_device *device) - if (!rds_ibdev->vector_load) { - pr_err("RDS/IB: %s failed to allocate vector memory\n", - __func__); + if (!rds_ibdev->vector_load) goto put_dev; - } rds_ibdev->dev = device; rds_ibdev->pd = ib_alloc_pd(device, 0);