diff --git a/fs/fs_opendir.c b/fs/fs_opendir.c index 3fa32fc1ed..82ce905f2e 100644 --- a/fs/fs_opendir.c +++ b/fs/fs_opendir.c @@ -205,8 +205,7 @@ FAR DIR *opendir(const char *path) * the tree semaphore and that would result in deadlock. */ - inode->i_crefs++; - inode->i_crefs++; + inode->i_crefs += 2; dir->u.psuedo.fd_next = inode; /* This is the next node to use for readdir() */ /* Flag the inode as belonging to the psuedo-filesystem */