提交 085294ef 编写于 作者: O openharmony_ci 提交者: Gitee

!37 BCHR关闭释放过程中可能存在危险

Merge pull request !37 from Far/master
......@@ -186,20 +186,18 @@ static int _files_close(struct file *filep)
}
VnodeHold();
vnode->useCount--;
VnodeDrop();
}
/* Block char device is removed when close */
if (vnode->type == VNODE_TYPE_BCHR)
{
VnodeHold();
ret = VnodeFree(vnode);
if (ret < 0)
/* Block char device is removed when close */
if (vnode->type == VNODE_TYPE_BCHR)
{
PRINTK("Removing bchar device %s failed\n", filep->f_path);
ret = VnodeFree(vnode);
if (ret < 0)
{
PRINTK("Removing bchar device %s failed\n", filep->f_path);
}
}
VnodeDrop();
}
/* Release the path of file */
free(filep->f_path);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册