Skip to content

Commit

Permalink
staging: omapdrm/omap_gem_dmabuf.c: fix memory leakage
Browse files Browse the repository at this point in the history
There is a memory leakage in variable sg if it goes to error.

Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ccding authored and robclark committed Feb 16, 2013
1 parent 238083a commit 32ac1a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/omapdrm/omap_gem_dmabuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ static struct sg_table *omap_gem_map_dma_buf(
/* this should be after _get_paddr() to ensure we have pages attached */
omap_gem_dma_sync(obj, dir);

out:
if (ret)
return ERR_PTR(ret);
return sg;
out:
kfree(sg);
return ERR_PTR(ret);
}

static void omap_gem_unmap_dma_buf(struct dma_buf_attachment *attachment,
Expand Down

0 comments on commit 32ac1a5

Please sign in to comment.