This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 40581558d3a3064abc3fc3abebb9b7763ad65c22
Author: chao an <anc...@xiaomi.com>
AuthorDate: Sun Nov 20 21:45:32 2022 +0800

    drivers/loop: destroy nxmutex properly
---
 drivers/loop/losetup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/loop/losetup.c b/drivers/loop/losetup.c
index cdc7032915..8ea964b864 100644
--- a/drivers/loop/losetup.c
+++ b/drivers/loop/losetup.c
@@ -408,6 +408,7 @@ errout_with_file:
   file_close(&dev->devfile);
 
 errout_with_dev:
+  nxmutex_destroy(&dev->lock);
   kmm_free(dev);
   return ret;
 }
@@ -471,6 +472,7 @@ int loteardown(FAR const char *devname)
       file_close(&dev->devfile);
     }
 
+  nxmutex_destroy(&dev->lock);
   kmm_free(dev);
   return ret;
 }

Reply via email to