mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
26b0332e30
commit
9022e24e89
|
@ -133,7 +133,10 @@ struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops,
|
||||||
dmabuf->exp_name = exp_name;
|
dmabuf->exp_name = exp_name;
|
||||||
|
|
||||||
file = anon_inode_getfile("dmabuf", &dma_buf_fops, dmabuf, flags);
|
file = anon_inode_getfile("dmabuf", &dma_buf_fops, dmabuf, flags);
|
||||||
|
if (IS_ERR(file)) {
|
||||||
|
kfree(dmabuf);
|
||||||
|
return ERR_CAST(file);
|
||||||
|
}
|
||||||
dmabuf->file = file;
|
dmabuf->file = file;
|
||||||
|
|
||||||
mutex_init(&dmabuf->lock);
|
mutex_init(&dmabuf->lock);
|
||||||
|
|
Loading…
Reference in New Issue