summaryrefslogtreecommitdiffstats
path: root/api/src/glfs-fops.c
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/glfs-fops.c')
-rw-r--r--api/src/glfs-fops.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index 48bbf224d87..5209ce3959a 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -803,7 +803,6 @@ glfs_io_async_cbk (int op_ret, int op_errno, call_frame_t *frame,
GF_VALIDATE_OR_GOTO ("gfapi", frame, inval);
GF_VALIDATE_OR_GOTO ("gfapi", cookie, inval);
- GF_VALIDATE_OR_GOTO ("gfapi", iovec, inval);
gio = frame->local;
frame->local = NULL;
@@ -817,6 +816,12 @@ glfs_io_async_cbk (int op_ret, int op_errno, call_frame_t *frame,
if (op_ret <= 0) {
goto out;
} else if (gio->op == GF_FOP_READ) {
+ if (!iovec) {
+ op_ret = -1;
+ op_errno = EINVAL;
+ goto out;
+ }
+
op_ret = iov_copy (gio->iov, gio->count, iovec, count);
glfd->offset = gio->offset + op_ret;
} else if (gio->op == GF_FOP_WRITE) {