diff --git a/fs/aio/aio_fsync.c b/fs/aio/aio_fsync.c index 932656bd25..9c2075a6c1 100644 --- a/fs/aio/aio_fsync.c +++ b/fs/aio/aio_fsync.c @@ -191,7 +191,12 @@ int aio_fsync(int op, FAR struct aiocb *aiocbp) FAR struct aio_container_s *aioc; int ret; - DEBUGASSERT(op == O_SYNC); /* || op == O_DSYNC */ + if (op != O_SYNC) + { + set_errno(EINVAL); + return ERROR; + } + DEBUGASSERT(aiocbp); /* The result -EINPROGRESS means that the transfer has not yet completed */