From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
To: netdev@vger.kernel.org
Cc: jallen@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com,
Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Subject: [PATCH 1/3] ibmvnic: Free coherent DMA memory if FW map failed
Date: Wed, 16 May 2018 15:49:03 -0500 [thread overview]
Message-ID: <1526503745-14421-2-git-send-email-tlfalcon@linux.vnet.ibm.com> (raw)
In-Reply-To: <1526503745-14421-1-git-send-email-tlfalcon@linux.vnet.ibm.com>
If the firmware map fails for whatever reason, remember to free
up the memory after.
Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ibmvnic.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 6e8d6a6..9e08917 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -192,6 +192,7 @@ static int alloc_long_term_buff(struct ibmvnic_adapter *adapter,
if (adapter->fw_done_rc) {
dev_err(dev, "Couldn't map long term buffer,rc = %d\n",
adapter->fw_done_rc);
+ dma_free_coherent(dev, ltb->size, ltb->buff, ltb->addr);
return -1;
}
return 0;
--
1.8.3.1
next prev parent reply other threads:[~2018-05-16 20:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-16 20:49 [PATCH 0/3] ibmvnic: Fix bugs and memory leaks Thomas Falcon
2018-05-16 20:49 ` Thomas Falcon [this message]
2018-05-16 20:49 ` [PATCH 2/3] ibmvnic: Fix non-fatal firmware error reset Thomas Falcon
2018-05-16 20:49 ` [PATCH 3/3] ibmvnic: Fix statistics buffers memory leak Thomas Falcon
2018-05-16 20:59 ` [PATCH 0/3] ibmvnic: Fix bugs and memory leaks Thomas Falcon
2018-05-17 18:57 ` David Miller
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=1526503745-14421-2-git-send-email-tlfalcon@linux.vnet.ibm.com \
--to=tlfalcon@linux.vnet.ibm.com \
--cc=jallen@linux.vnet.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=nfont@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).