9pfs: fix file descriptor leak
The v9fs_create() and v9fs_lcreate() functions are used to create a file on the backend and to associate it to a fid. The fid shouldn't be already in-use, otherwise both functions may silently leak a file descriptor or allocated memory. The current code doesn't check that. This patch ensures that the fid isn't already associated to anything before using it. Signed-off-by: NLi Qiang <liqiang6-s@360.cn> (reworded the changelog, Greg Kurz) Signed-off-by: NGreg Kurz <groug@kaod.org>
Showing
想要评论请 注册 或 登录