提交 9022e24e 编写于 作者: T Tuomas Tynkkynen 提交者: Sumit Semwal

dma-buf: Check return value of anon_inode_getfile

anon_inode_getfile might fail, so check its return value.
Signed-off-by: NTuomas Tynkkynen <ttynkkynen@nvidia.com>
Signed-off-by: NSumit Semwal <sumit.semwal@linaro.org>
上级 26b0332e
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册