diff options
author | Satish <x0124230@ti.com> | 2010-06-09 06:21:27 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-06-09 06:21:27 -0400 |
commit | 7f1225bd6e62c54edfa0a2464648ad9e4efb1313 (patch) | |
tree | fb70cbe45d50b9728865db0417eb04dec12ca942 | |
parent | 386f40c86d6c8d5b717ef20620af1a750d0dacb4 (diff) |
omap iommu: Fix Memory leak
The memory allocated for sgt structure is not freed on error
when sg_alloc_table is called in sgtable_alloc().
Signed-off-by: Satish Kumar <x0124230@ti.com>
Signed-off-by: Manjunatha GK <manjugk@ti.com>
Cc: Vimal Singh <vimal.newwork@gmail.com>
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgen <tony@atomide.com>
-rw-r--r-- | arch/arm/plat-omap/iovmm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c index e43983ba59c5..8ce0de247c71 100644 --- a/arch/arm/plat-omap/iovmm.c +++ b/arch/arm/plat-omap/iovmm.c | |||
@@ -140,8 +140,10 @@ static struct sg_table *sgtable_alloc(const size_t bytes, u32 flags) | |||
140 | return ERR_PTR(-ENOMEM); | 140 | return ERR_PTR(-ENOMEM); |
141 | 141 | ||
142 | err = sg_alloc_table(sgt, nr_entries, GFP_KERNEL); | 142 | err = sg_alloc_table(sgt, nr_entries, GFP_KERNEL); |
143 | if (err) | 143 | if (err) { |
144 | kfree(sgt); | ||
144 | return ERR_PTR(err); | 145 | return ERR_PTR(err); |
146 | } | ||
145 | 147 | ||
146 | pr_debug("%s: sgt:%p(%d entries)\n", __func__, sgt, nr_entries); | 148 | pr_debug("%s: sgt:%p(%d entries)\n", __func__, sgt, nr_entries); |
147 | 149 | ||