From 9b2b700fa0e3a8edadb38f09c917a3e3f013347f Mon Sep 17 00:00:00 2001 From: Far Date: Tue, 27 Apr 2021 16:49:23 +0800 Subject: [PATCH] fix: some branch in format does not release the vnode mutex properly if fatfs_mkfs returns a error, format may return without drop the vnode mutex, which may cause deadlock Close #I3OFAY --- fs/fat/os_adapt/format.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/fat/os_adapt/format.c b/fs/fat/os_adapt/format.c index 72a1a6f0..e2b3458c 100644 --- a/fs/fat/os_adapt/format.c +++ b/fs/fat/os_adapt/format.c @@ -78,6 +78,7 @@ int format(const char *dev, int sectors, int option) } err = fatfs_mkfs(device, sectors, option); if (err < 0) { + VnodeDrop(); set_errno(-err); return -1; }