From 3727de1a93d813febbe3fe25916abb3307947fe4 Mon Sep 17 00:00:00 2001 From: chao an Date: Sun, 20 Nov 2022 21:36:28 +0800 Subject: [PATCH] fs/userfs: destroy nxmutex properly Signed-off-by: chao an --- fs/userfs/fs_userfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/userfs/fs_userfs.c b/fs/userfs/fs_userfs.c index 063c3aec30..8dff18f5d4 100644 --- a/fs/userfs/fs_userfs.c +++ b/fs/userfs/fs_userfs.c @@ -1487,6 +1487,7 @@ errout_with_psock: psock_close(&priv->psock); errout_with_alloc: + nxmutex_destroy(&priv->lock); kmm_free(priv); return ret; } @@ -1570,6 +1571,7 @@ static int userfs_unbind(FAR void *handle, FAR struct inode **blkdriver, /* Free resources and return success */ psock_close(&priv->psock); + nxmutex_destroy(&priv->lock); kmm_free(priv); return OK; }