From patchwork Wed Apr 3 13:52:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10883843 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-2.web.codeaurora.org (Postfix) with ESMTP id 3740717E1 for ; Wed, 3 Apr 2019 13:53:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 215A1289FB for ; Wed, 3 Apr 2019 13:53:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F8F328985; Wed, 3 Apr 2019 13:53: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,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 B64A4289FB for ; Wed, 3 Apr 2019 13:53:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726477AbfDCNxO (ORCPT ); Wed, 3 Apr 2019 09:53:14 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43780 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbfDCNxN (ORCPT ); Wed, 3 Apr 2019 09:53:13 -0400 Received: by mail-wr1-f66.google.com with SMTP id k17so21458428wrx.10 for ; Wed, 03 Apr 2019 06:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=In3o4id8Xfj0RYu6V24bbagd9/KJwAQmWMmBwZhlsSA=; b=O04FtTPiOAhc7bBFmZiaW9umnvgNrcJib/MYVJHCQTlK1vI2kQmgUZfHFE47dUMO5S omDrDSPAsvoM9nDS9S35gA3OwY8gALCMqDtYq7b/0DPmwCER3rs5KEPnIAyx67JfpJjc pyQuL9fsR8u18NDMqWL3HFW+muYtY+Cb1ctu3f0S6yW9dU5/F/ELhCznrEljapDf0hFO P+9keYTE/UHo6Wg+mzbYo49Dk9hOy43Bv3WiP7/MuoVc6i6KKBi3cPhkNhDojzhwCgN2 6WLZsSbCXy9VD9qP7Y15WlNghO/oicuRLq3ZSyvbP09+/RDG4ajDa0XMnd4UQANVzTW+ enZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=In3o4id8Xfj0RYu6V24bbagd9/KJwAQmWMmBwZhlsSA=; b=N9EOLRsKL4fckJAd/Uz/R/o5OayttVSU7pC0TzmS5feqbt7nfUbIcZuuBl5QI5YZAO BIB0OJ3tScJXRZGDcJZq18ttlkPgCHt1KCMZT/wHBdjSG2IDAsc2xSXSPU8bwuBJANcc 4yVMqmyrjaWu9mPu/+WiNdW0hd5LGNZZyGufaPyPvTkBTXQ6a0fPS7HDIexUOmdvBrwO v4jrkRvDXIK2wzn3qagKNqnT80margrtPEVGRvntjDqEfomGopuIzi33oiG0mDVqS+UX 5IlnPNTVV7iHUvlipKnFrpBPNLoHij1xQRSCwDYWmtwiapH4xwMsz4AGSc4HWAli6PnM ctGw== X-Gm-Message-State: APjAAAXzWGaoxfGzznzXmWLzjn1J2BBhazDVT6aHkguo5NcVAG9SzBak v3VvqKwmBURtBwtRLXgS8DJGF5Hy X-Google-Smtp-Source: APXvYqysKpc+FC0/mMh1Jy+FSdqvLpmihAjH72KkTwrw2ExfUKLKHHpdgFJ2M4dBRwzyycaOeBN5ng== X-Received: by 2002:adf:ba81:: with SMTP id p1mr48212350wrg.192.1554299591480; Wed, 03 Apr 2019 06:53:11 -0700 (PDT) Received: from kheib-workstation.redhat.com ([192.116.94.220]) by smtp.gmail.com with ESMTPSA id k14sm12187594wmj.26.2019.04.03.06.53.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Apr 2019 06:53:10 -0700 (PDT) From: Kamal Heib To: linux-rdma@vger.kernel.org Cc: Adit Ranadive , Kamal Heib Subject: [PATCH for-rc] RDMA/vmw_pvrdma: Fix memory leak on pvrdma_pci_remove Date: Wed, 3 Apr 2019 16:52:54 +0300 Message-Id: <20190403135254.31391-1-kamalheib1@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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 Make sure to free the DSR on pvrdma_pci_remove() to avoid the memory leak. Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver") Signed-off-by: Kamal Heib Acked-by: Adit Ranadive --- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c index 6d8b3e0de57a..ec41400fec0c 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c @@ -1131,6 +1131,8 @@ static void pvrdma_pci_remove(struct pci_dev *pdev) pvrdma_page_dir_cleanup(dev, &dev->cq_pdir); pvrdma_page_dir_cleanup(dev, &dev->async_pdir); pvrdma_free_slots(dev); + dma_free_coherent(&pdev->dev, sizeof(*dev->dsr), dev->dsr, + dev->dsrbase); iounmap(dev->regs); kfree(dev->sgid_tbl);