From patchwork Mon Nov 6 14:35:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 10043641 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 7692B602BF for ; Mon, 6 Nov 2017 14:59:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77AF128C29 for ; Mon, 6 Nov 2017 14:59:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C7292915C; Mon, 6 Nov 2017 14:59:53 +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 EAB4C2929C for ; Mon, 6 Nov 2017 14:59:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932165AbdKFO7v (ORCPT ); Mon, 6 Nov 2017 09:59:51 -0500 Received: from gateway31.websitewelcome.com ([192.185.143.38]:24714 "EHLO gateway31.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932129AbdKFO7v (ORCPT ); Mon, 6 Nov 2017 09:59:51 -0500 X-Greylist: delayed 1474 seconds by postgrey-1.27 at vger.kernel.org; Mon, 06 Nov 2017 09:59:51 EST Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 1564C4FDA7 for ; Mon, 6 Nov 2017 08:35:17 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id BiUfej4fJ5b6TBiUfexILS; Mon, 06 Nov 2017 08:35:17 -0600 Received: from [189.145.38.148] (port=46390 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1eBiUe-002cbP-KC; Mon, 06 Nov 2017 08:35:16 -0600 Date: Mon, 6 Nov 2017 08:35:14 -0600 From: "Gustavo A. R. Silva" To: Selvin Xavier , Devesh Sharma , Doug Ledford Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] IB/ocrdma_hw: remove unnecessary code in ocrdma_mbx_dealloc_lkey Message-ID: <20171106143514.GA19786@embeddedor.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.145.38.148 X-Source-L: No X-Exim-ID: 1eBiUe-002cbP-KC X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.145.38.148]:46390 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 8 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes 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 Check on return value and goto label mbx_err are unnecessary. Addresses-Coverity-ID: 1268780 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Yuval Shaia --- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c index f8c14c7..db02bbb 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c @@ -1956,9 +1956,7 @@ int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev *dev, int fr_mr, u32 lkey) cmd->lkey = lkey; cmd->rsvd_frmr = fr_mr ? 1 : 0; status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd); - if (status) - goto mbx_err; -mbx_err: + kfree(cmd); return status; }