projects
/
platform
/
upstream
/
erofs-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
945b6fe
)
erofs-utils: lib: fix fd leak on failure in erofs_dev_open()
author
Gao Xiang
<hsiangkao@linux.alibaba.com>
Fri, 2 Aug 2024 01:55:27 +0000
(09:55 +0800)
committer
Gao Xiang
<hsiangkao@linux.alibaba.com>
Sun, 4 Aug 2024 01:51:05 +0000
(09:51 +0800)
Coverity-id: 502356
Reviewed-by: Sandeep Dhavale <dhavale@google.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link:
https://lore.kernel.org/r/20240802015527.2113797-3-hsiangkao@linux.alibaba.com
lib/io.c
patch
|
blob
|
history
diff --git
a/lib/io.c
b/lib/io.c
index 4937db5fa4a1df8a2bc844202aba8efd42c8c21e..6bfae6995b759f0f044e3f2240b43682fe54e984 100644
(file)
--- a/
lib/io.c
+++ b/
lib/io.c
@@
-258,8
+258,10
@@
repeat:
#if defined(HAVE_SYS_STATFS_H) && defined(HAVE_FSTATFS)
struct statfs stfs;
- if (again)
+ if (again) {
+ close(fd);
return -ENOTEMPTY;
+ }
/*
* fses like EXT4 and BTRFS will flush dirty blocks