Skip to content

Commit

Permalink
drivers/misc/spear13xx_pcie_gadget.c: fix a memory leak in spear_pcie…
Browse files Browse the repository at this point in the history
…_gadget_probe error path

In the case of goto err_kzalloc, we should kfree target.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Pratyush Anand <pratyush.anand@st.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
AxelLin authored and torvalds committed Jun 16, 2011
1 parent 32e45ff commit 5a1e6f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/misc/spear13xx_pcie_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ static int __devinit spear_pcie_gadget_probe(struct platform_device *pdev)
err_iounmap_app:
iounmap(config->va_app_base);
err_kzalloc:
kfree(config);
kfree(target);
err_rel_res:
release_mem_region(res1->start, resource_size(res1));
err_rel_res0:
Expand Down

0 comments on commit 5a1e6f7

Please sign in to comment.