fs/unionfs: fix bug about use after free about ui

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong 2022-04-01 10:37:54 +08:00 committed by Xiang Xiao
parent 4e581f76f1
commit 4631face24

View File

@ -1001,12 +1001,15 @@ static int unionfs_close(FAR struct file *filep)
{
unionfs_destroy(ui);
}
else
{
unionfs_semgive(ui);
}
/* Free the open file container */
kmm_free(uf);
filep->f_priv = NULL;
unionfs_semgive(ui);
return ret;
}