diff options
| author | Bernard Xiong <[email protected]> | 2015-09-12 10:53:04 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2015-09-12 10:53:04 +0800 |
| commit | 811a2ead68281f0fdc4cfbf0c3adda81ac9d10f4 (patch) | |
| tree | 90d3374621d7916f5eb8d892804ded6209ce5561 /components/dfs | |
| parent | 0da4930cc90b4f474bf73eb281daac05d4245b71 (diff) | |
| parent | 3bd1a372a038a70cc007f8f8c9a5c8acac96f9b4 (diff) | |
Merge pull request #549 from www220/fix
[DFS] fix the fd_put issue in mkdir and lseek error case.
Diffstat (limited to 'components/dfs')
| -rw-r--r-- | components/dfs/src/dfs_posix.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c index 250f6eaf7f..c379d5c969 100644 --- a/components/dfs/src/dfs_posix.c +++ b/components/dfs/src/dfs_posix.c @@ -230,6 +230,7 @@ off_t lseek(int fd, off_t offset, int whence) break; default: + fd_put(d); rt_set_errno(-DFS_STATUS_EINVAL); return -1; @@ -237,6 +238,7 @@ off_t lseek(int fd, off_t offset, int whence) if (offset < 0) { + fd_put(d); rt_set_errno(-DFS_STATUS_EINVAL); return -1; @@ -458,6 +460,7 @@ int mkdir(const char *path, mode_t mode) if (result < 0) { fd_put(d); + fd_put(d); rt_set_errno(result); return -1; @@ -465,6 +468,7 @@ int mkdir(const char *path, mode_t mode) dfs_file_close(d); fd_put(d); + fd_put(d); return 0; } |
