projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
26b0332
)
dma-buf: Check return value of anon_inode_getfile
author
Tuomas Tynkkynen
<ttynkkynen@nvidia.com>
Tue, 27 Aug 2013 13:30:38 +0000
(16:30 +0300)
committer
Sumit Semwal
<sumit.semwal@linaro.org>
Tue, 10 Sep 2013 05:59:21 +0000
(11:29 +0530)
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>
drivers/base/dma-buf.c
patch
|
blob
|
history
diff --git
a/drivers/base/dma-buf.c
b/drivers/base/dma-buf.c
index 1219ab7c310757cdd493baf9101000b0c5d286b0..2d5ac1a1842ea528d9dfd7d1cad48c42fab8cf8c 100644
(file)
--- 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,
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);