Skip to content

Commit

Permalink
dma-buf: Check return value of anon_inode_getfile
Browse files Browse the repository at this point in the history
anon_inode_getfile might fail, so check its return value.

Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
  • Loading branch information
Tuomas Tynkkynen authored and Sumit Semwal committed Sep 10, 2013
1 parent 26b0332 commit 9022e24
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/base/dma-buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops,
dmabuf->exp_name = exp_name;

file = anon_inode_getfile("dmabuf", &dma_buf_fops, dmabuf, flags);

if (IS_ERR(file)) {
kfree(dmabuf);
return ERR_CAST(file);
}
dmabuf->file = file;

mutex_init(&dmabuf->lock);
Expand Down

0 comments on commit 9022e24

Please sign in to comment.