diff options
author | Tuomas Tynkkynen <ttynkkynen@nvidia.com> | 2013-08-27 09:30:38 -0400 |
---|---|---|
committer | Sumit Semwal <sumit.semwal@linaro.org> | 2013-09-10 01:59:21 -0400 |
commit | 9022e24e8946400d53719a761815069c3183e2bd (patch) | |
tree | 56d5b6c40f1829eaf75d63b098fc7be5b5b60a94 /drivers/base/dma-buf.c | |
parent | 26b0332e30c7f93e780aaa054bd84e3437f84354 (diff) |
dma-buf: Check return value of anon_inode_getfile
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>
Diffstat (limited to 'drivers/base/dma-buf.c')
-rw-r--r-- | drivers/base/dma-buf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c index 1219ab7c3107..2d5ac1a1842e 100644 --- a/drivers/base/dma-buf.c +++ b/drivers/base/dma-buf.c | |||
@@ -133,7 +133,10 @@ struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops, | |||
133 | dmabuf->exp_name = exp_name; | 133 | dmabuf->exp_name = exp_name; |
134 | 134 | ||
135 | file = anon_inode_getfile("dmabuf", &dma_buf_fops, dmabuf, flags); | 135 | file = anon_inode_getfile("dmabuf", &dma_buf_fops, dmabuf, flags); |
136 | 136 | if (IS_ERR(file)) { | |
137 | kfree(dmabuf); | ||
138 | return ERR_CAST(file); | ||
139 | } | ||
137 | dmabuf->file = file; | 140 | dmabuf->file = file; |
138 | 141 | ||
139 | mutex_init(&dmabuf->lock); | 142 | mutex_init(&dmabuf->lock); |