Skip to content

Commit

Permalink
solo6x10: [P2M] Fix memory leak
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Collins <bcollins@bluecherry.net>
  • Loading branch information
Ben Collins committed Nov 8, 2010
1 parent 0e4de05 commit 5bf6859
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/staging/solo6x10/solo6010-p2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5bf6859

Please sign in to comment.