From: Tomas Henzl <thenzl@redhat.com>
To: linux-scsi@vger.kernel.org
Cc: sreekanth.reddy@broadcom.com, sathya.prakash@broadcom.com,
ranjan.kumar@broadcom.com
Subject: [PATCH v2 2/6] scsi: mpi3mr: fix a dma memory leak
Date: Fri, 3 Mar 2023 00:43:32 +0100 [thread overview]
Message-ID: <20230302234336.25456-3-thenzl@redhat.com> (raw)
In-Reply-To: <20230302234336.25456-1-thenzl@redhat.com>
A fix for:
DMA-API: pci 0000:83:00.0: device driver has pending DMA allocations while released from device [count=1]
Fixes: 32d457d5a2af ("scsi: mpi3mr: Add framework to issue config requests")
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
---
drivers/scsi/mpi3mr/mpi3mr_fw.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
index b632e1bb1007..fa62991f5aee 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@ -4396,7 +4396,11 @@ void mpi3mr_free_mem(struct mpi3mr_ioc *mrioc)
mrioc->admin_req_base, mrioc->admin_req_dma);
mrioc->admin_req_base = NULL;
}
-
+ if (mrioc->cfg_page) {
+ dma_free_coherent(&mrioc->pdev->dev, mrioc->cfg_page_sz,
+ mrioc->cfg_page, mrioc->cfg_page_dma);
+ mrioc->cfg_page = NULL;
+ }
if (mrioc->pel_seqnum_virt) {
dma_free_coherent(&mrioc->pdev->dev, mrioc->pel_seqnum_sz,
mrioc->pel_seqnum_virt, mrioc->pel_seqnum_dma);
--
2.39.1
next prev parent reply other threads:[~2023-03-02 23:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-02 23:43 [PATCH v2 0/6] scsi: mpi3mr: fix few resource leaks Tomas Henzl
2023-03-02 23:43 ` [PATCH v2 1/6] scsi: mpi3mr: fix a memory leak Tomas Henzl
2023-03-02 23:43 ` Tomas Henzl [this message]
2023-03-02 23:43 ` [PATCH v2 3/6] " Tomas Henzl
2023-03-02 23:43 ` [PATCH v2 4/6] " Tomas Henzl
2023-03-02 23:43 ` [PATCH v2 5/6] " Tomas Henzl
2023-03-02 23:43 ` [PATCH v2 6/6] " Tomas Henzl
2023-03-07 1:43 ` [PATCH v2 0/6] scsi: mpi3mr: fix few resource leaks Martin K. Petersen
2023-03-07 20:14 ` Sathya Prakash Veerichetty
2023-03-10 3:13 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230302234336.25456-3-thenzl@redhat.com \
--to=thenzl@redhat.com \
--cc=linux-scsi@vger.kernel.org \
--cc=ranjan.kumar@broadcom.com \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox