From patchwork Sat Jan 27 21:19:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10187647 X-Patchwork-Delegate: jgg@ziepe.ca 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 0806A602C8 for ; Sat, 27 Jan 2018 21:19:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA8112018E for ; Sat, 27 Jan 2018 21:19:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF17428B09; Sat, 27 Jan 2018 21:19:32 +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 993E62018E for ; Sat, 27 Jan 2018 21:19:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752962AbeA0VTS (ORCPT ); Sat, 27 Jan 2018 16:19:18 -0500 Received: from mout.web.de ([212.227.17.12]:57551 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752702AbeA0VTR (ORCPT ); Sat, 27 Jan 2018 16:19:17 -0500 Received: from [192.168.1.2] ([78.49.117.84]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LtFQN-1emiu02KuR-012tUX; Sat, 27 Jan 2018 22:19:07 +0100 Subject: [PATCH 1/3] RDMA/iwpm: Delete an error message for a failed memory allocation in iwpm_create_nlmsg() From: SF Markus Elfring To: linux-rdma@vger.kernel.org, Chien Tin Tung , Doug Ledford , Geert Uytterhoeven , Jason Gunthorpe , Johannes Berg , Leon Romanovsky , Shiraz Saleem , Tatyana Nikolova Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: Date: Sat, 27 Jan 2018 22:19:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:wzercI13lenjzuzmXyVJtA+bNlx3ovA0ssyD+rS3DN1Rvq5HRSs wn9UZ0KCWcxvaJs2U8OT2NmMd5EzcrYOVCnKQpMGdlLrYFuQqD/C/Ce2eYvD42XMAIW/7HD d/fo67a1DA8Pg8kcbbP2T6l4hDIXNOfDSWTfwKgzOGyI4SxlBXKyE+oi9b1AI0Sqttql+pc XaUobsSPQyu0gulDyxVhQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:Eys0RIl92WE=:z5tvIq0g4f0HHWv2sYQvq4 poII3sn6r7cbqmDrQ25vaV/tcXn/FTOJU4qMU1c2JEgJwUpFtK/+xCAdGWM5EAFoBCUfaOtrK Yc+q/+JzLlBNyj3Zk08DMgrMKok2a3n8PdXyIsnxUe2nNxESd7jtBMLnIjr4RE0/KFFSnVszU 71pp8MfDVLhCkmucwzNVTrD3+vuVjatZtxTMHV1wgsEeBXescKORujkBdcmfwQeof+CIwm2j+ gyHJi+BSbqHWaxeknQxYOKjxVBQazeoOHfWBc4EKZIhghnpDN0LtHsrjZpnytDVA+1tdy7AWv j1UxDtMj0cmlncEyzR9GGRR+wxWgCNELbhPOQz5vZujGdl+UyX9jLPrxUqRScWowfL+Yt9H6+ tFjY/qA3vhnRnBAG4UhT5qs8AQ2ZYyYNQ1N0MSRgzDJDwjinYYy9pdbtO4FqL+T6CmbtQrYNt /ec/KhR6sBN0X/GbEes4In7bgYjiQ+lM88oj2s3IYgxBiKZx3uPdigBclb3UelgbpXTd0XjeX Y775gTzCAB6MkmiVFyFrp/naflVqfT847luKVfBJ1ND0SMlQKTz92uyfHKkXZvBLuqlW9lql/ UKnFRH0UzkjdM46vT0t5C5yiAjzdiR37E2GmKhMYYNQ75kcHktrfzhVKBAHBLpZNCHRgj0mh6 JTZ7dNWU/G9v7ayLag2GajMyBKxRLY5qsIpPeA8I183sPnF83lo+vgv2V7pxbv5lnrE1n0Qw0 EBGeYhmZGcYFUoVAaLv8e1BV/ObRjjnFAl6c7i/aWT1jXUhPdgBsBJ9i3HmM6Uj7ZSwGhLSal jOmhqQdyWa9/1xSCeWHm169hey5dIvoHcMdJ+zxztDqXbBk5mU= 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: Sat, 27 Jan 2018 21:48:01 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/infiniband/core/iwpm_util.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/core/iwpm_util.c b/drivers/infiniband/core/iwpm_util.c index 81528f64061a..9821ae900f6d 100644 --- a/drivers/infiniband/core/iwpm_util.c +++ b/drivers/infiniband/core/iwpm_util.c @@ -439,10 +439,9 @@ struct sk_buff *iwpm_create_nlmsg(u32 nl_op, struct nlmsghdr **nlh, struct sk_buff *skb = NULL; skb = dev_alloc_skb(IWPM_MSG_SIZE); - if (!skb) { - pr_err("%s Unable to allocate skb\n", __func__); + if (!skb) goto create_nlmsg_exit; - } + if (!(ibnl_put_msg(skb, nlh, 0, 0, nl_client, nl_op, NLM_F_REQUEST))) { pr_warn("%s: Unable to put the nlmsg header\n", __func__);