From patchwork Tue Feb 4 06:27:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 3574081 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1A516C02DD for ; Tue, 4 Feb 2014 06:56:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D6512018A for ; Tue, 4 Feb 2014 06:56:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 904AB2017B for ; Tue, 4 Feb 2014 06:56:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753089AbaBDG4Q (ORCPT ); Tue, 4 Feb 2014 01:56:16 -0500 Received: from cmexedge2.ext.emulex.com ([138.239.224.100]:54031 "EHLO CMEXEDGE2.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753063AbaBDG4L (ORCPT ); Tue, 4 Feb 2014 01:56:11 -0500 Received: from CMEXHTCAS2.ad.emulex.com (138.239.115.218) by CMEXEDGE2.ext.emulex.com (138.239.224.100) with Microsoft SMTP Server (TLS) id 14.3.174.1; Mon, 3 Feb 2014 22:56:53 -0800 Received: from neo01.lab.bg.emulex.com (10.192.204.8) by smtp.emulex.com (138.239.115.208) with Microsoft SMTP Server id 14.3.174.1; Mon, 3 Feb 2014 22:56:05 -0800 From: Devesh Sharma To: CC: , , Selvin Xavier , Devesh Sharma Subject: [PATCH for-next 09/17] RDMA/ocrdma: Memory leak fix in ocrdma_dereg_mr Date: Tue, 4 Feb 2014 11:57:02 +0530 X-Mailer: git-send-email 1.7.1 In-Reply-To: <1391495230-28021-1-git-send-email-devesh.sharma@emulex.com> References: <1391495230-28021-1-git-send-email-devesh.sharma@emulex.com> MIME-Version: 1.0 Message-ID: Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Selvin Xavier Fix for memory leak in ocrdma_dereg_mr. Signed-off-by: Selvin Xavier Signed-off-by: Devesh Sharma --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index ef4e92e..96d1e85 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -840,8 +840,7 @@ int ocrdma_dereg_mr(struct ib_mr *ib_mr) status = ocrdma_mbx_dealloc_lkey(dev, mr->hwmr.fr_mr, mr->hwmr.lkey); - if (mr->hwmr.fr_mr == 0) - ocrdma_free_mr_pbl_tbl(dev, &mr->hwmr); + ocrdma_free_mr_pbl_tbl(dev, &mr->hwmr); /* it could be user registered memory. */ if (mr->umem)