summaryrefslogtreecommitdiff
path: root/nuttx/fs/fs_write.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/fs/fs_write.c')
-rw-r--r--nuttx/fs/fs_write.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nuttx/fs/fs_write.c b/nuttx/fs/fs_write.c
index 7de7898f4..b0d523a45 100644
--- a/nuttx/fs/fs_write.c
+++ b/nuttx/fs/fs_write.c
@@ -156,7 +156,7 @@ int write(int fd, const void *buf, unsigned int nbytes)
/* Is a driver registered? Does it support the write method? */
inode = this_file->f_inode;
- if (!inode || !inode->u.i_ops && inode->u.i_ops->write)
+ if (!inode || !inode->u.i_ops || !inode->u.i_ops->write)
{
err = EBADF;
goto errout;