diff --git a/fs/mount/fs_foreachmountpoint.c b/fs/mount/fs_foreachmountpoint.c index 4688ba4d386..8423b732b96 100644 --- a/fs/mount/fs_foreachmountpoint.c +++ b/fs/mount/fs_foreachmountpoint.c @@ -106,7 +106,7 @@ static int mountpoint_filter(FAR struct inode *node, if (pathlen + namlen > PATH_MAX) { - return -ENAMETOOLONG; + return OK; } /* Append the inode name to the directory path */ @@ -115,8 +115,7 @@ static int mountpoint_filter(FAR struct inode *node, /* Get the status of the file system */ - ret = node->u.i_mops->statfs(node, &statbuf); - if (ret == OK) + if (node->u.i_mops->statfs(node, &statbuf) == OK) { /* And pass the full path and file system status to the handler */