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; }