projects
/
rtos
/
tinyara.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9dcdfd4
)
Fix memory leak in fs_clean
author
TaeJun Kwon
<tj80.kwon@samsung.com>
Thu, 13 Apr 2017 08:30:28 +0000
(17:30 +0900)
committer
TaeJun Kwon
<tj80.kwon@samsung.com>
Thu, 13 Apr 2017 08:30:28 +0000
(17:30 +0900)
if smart_clean failed, inode never released
os/fs/fs_utils.c
patch
|
blob
|
history
diff --git
a/os/fs/fs_utils.c
b/os/fs/fs_utils.c
index
d336c77
..
eb8dd1e
100644
(file)
--- a/
os/fs/fs_utils.c
+++ b/
os/fs/fs_utils.c
@@
-161,7
+161,7
@@
int fs_clean(char *dev_name)
if (ret != OK) {
fdbg("smart_clean failed : %d\n", ret);
ret = -ret;
- goto error_
out
;
+ goto error_
with_inode
;
}
mtd = NULL;
#endif
@@
-169,6
+169,10
@@
int fs_clean(char *dev_name)
inode_release(inode);
inode = NULL;
+#if defined(CONFIG_MTD) && defined(CONFIG_MTD_SMART)
+error_with_inode:
+ inode_release(inode);
+#endif
error_out:
return ret > 0 ? -ret : ret;
}