summaryrefslogtreecommitdiff
path: root/fs/yaffs2/yaffs_fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/yaffs2/yaffs_fs.c')
-rw-r--r--fs/yaffs2/yaffs_fs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/yaffs2/yaffs_fs.c b/fs/yaffs2/yaffs_fs.c
index 30ae7c7e259a..2288eeee2d77 100644
--- a/fs/yaffs2/yaffs_fs.c
+++ b/fs/yaffs2/yaffs_fs.c
@@ -1075,7 +1075,7 @@ static ssize_t yaffs_file_write(struct file *f, const char *buf, size_t n,
}
yaffs_GrossUnlock(dev);
- return nWritten == 0 ? -ENOSPC : nWritten;
+ return (!nWritten && n) ? -ENOSPC : nWritten;
}
/* Space holding and freeing is done to ensure we have space available for write_begin/end */