mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-27 03:47:43 +00:00
hostfs: hostfs_file_open: Fix a fd leak in hostfs_file_open
In case of a race between to callers of hostfs_file_open() it can happen that a file describtor is leaked. Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
69886e676e
commit
af9556586a
@ -329,6 +329,7 @@ retry:
|
||||
/* somebody else had handled it first? */
|
||||
if ((mode & HOSTFS_I(ino)->mode) == mode) {
|
||||
mutex_unlock(&HOSTFS_I(ino)->open_mutex);
|
||||
close_file(&fd);
|
||||
return 0;
|
||||
}
|
||||
if ((mode | HOSTFS_I(ino)->mode) != mode) {
|
||||
|
Loading…
Reference in New Issue
Block a user