summaryrefslogtreecommitdiffstats
path: root/drivers/staging/solo6x10
diff options
context:
space:
mode:
authorBen Collins <bcollins@bluecherry.net>2010-11-08 10:07:42 -0500
committerBen Collins <bcollins@bluecherry.net>2010-11-08 10:07:42 -0500
commit5bf68592e72eb0ded154efaaf43b39aab6964fc3 (patch)
tree39317ce20e380174e3be94cb5dddbb43ca8ca54c /drivers/staging/solo6x10
parent0e4de059d90c96930ab237e7d4fbb7e3814afcb6 (diff)
downloadlinux-5bf68592e72eb0ded154efaaf43b39aab6964fc3.tar.gz
linux-5bf68592e72eb0ded154efaaf43b39aab6964fc3.tar.bz2
linux-5bf68592e72eb0ded154efaaf43b39aab6964fc3.zip
solo6x10: [P2M] Fix memory leak
Signed-off-by: Ben Collins <bcollins@bluecherry.net>
Diffstat (limited to 'drivers/staging/solo6x10')
-rw-r--r--drivers/staging/solo6x10/solo6010-p2m.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/solo6x10/solo6010-p2m.c b/drivers/staging/solo6x10/solo6010-p2m.c
index 9f2418093af5..c91fc4652a00 100644
--- a/drivers/staging/solo6x10/solo6010-p2m.c
+++ b/drivers/staging/solo6x10/solo6010-p2m.c
@@ -51,13 +51,16 @@ int solo_p2m_dma_t(struct solo6010_dev *solo_dev, u8 id, int wr,
dma_addr_t dma_addr, u32 ext_addr, u32 size)
{
struct p2m_desc *desc = kzalloc(sizeof(*desc) * 2, GFP_DMA);
+ int ret;
if (desc == NULL)
return -ENOMEM;
solo_p2m_push_desc(&desc[1], wr, dma_addr, ext_addr, size, 0, 0);
+ ret = solo_p2m_dma_desc(solo_dev, id, desc, 2);
+ kfree(desc);
- return solo_p2m_dma_desc(solo_dev, id, desc, 2);
+ return ret;
}
void solo_p2m_push_desc(struct p2m_desc *desc, int wr, dma_addr_t dma_addr,