When using INIT_UDATA() with an output buffer set to NULL,
there's no space available, so output buffer length should be set to 0.

Signed-off-by: Yann Droneaud <[email protected]>
Link: http://mid.gmane.org/[email protected]
---
 drivers/infiniband/core/uverbs_cmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/core/uverbs_cmd.c 
b/drivers/infiniband/core/uverbs_cmd.c
index 5981604..df50e81 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -1990,7 +1990,7 @@ ssize_t ib_uverbs_modify_qp(struct ib_uverbs_file *file,
                return -EFAULT;
 
        INIT_UDATA(&udata, buf + sizeof cmd, NULL, in_len - sizeof cmd,
-                  out_len);
+                  0);
 
        attr = kmalloc(sizeof *attr, GFP_KERNEL);
        if (!attr)
@@ -2927,7 +2927,7 @@ ssize_t ib_uverbs_modify_srq(struct ib_uverbs_file *file,
                return -EFAULT;
 
        INIT_UDATA(&udata, buf + sizeof cmd, NULL, in_len - sizeof cmd,
-                  out_len);
+                  0);
 
        srq = idr_read_srq(cmd.srq_handle, file->ucontext);
        if (!srq)
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to