aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds
diff options
context:
space:
mode:
Diffstat (limited to 'net/rds')
-rw-r--r--net/rds/message.c2
-rw-r--r--net/rds/send.c13
2 files changed, 8 insertions, 7 deletions
diff --git a/net/rds/message.c b/net/rds/message.c
index 4bd9504ca048..f4c3be0878e9 100644
--- a/net/rds/message.c
+++ b/net/rds/message.c
@@ -330,8 +330,6 @@ int rds_message_copy_from_user(struct rds_message *rm, struct iovec *first_iov,
330 sg++; 330 sg++;
331 } 331 }
332 332
333 rm->data.op_active = 1;
334
335out: 333out:
336 return ret; 334 return ret;
337} 335}
diff --git a/net/rds/send.c b/net/rds/send.c
index 66dc6b045261..ad89a63c4304 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -970,11 +970,14 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
970 goto out; 970 goto out;
971 } 971 }
972 972
973 rm->data.op_sg = rds_message_alloc_sgs(rm, ceil(payload_len, PAGE_SIZE)); 973 /* Attach data to the rm */
974 /* XXX fix this to not allocate memory */ 974 if (payload_len) {
975 ret = rds_message_copy_from_user(rm, msg->msg_iov, payload_len); 975 rm->data.op_sg = rds_message_alloc_sgs(rm, ceil(payload_len, PAGE_SIZE));
976 if (ret) 976 ret = rds_message_copy_from_user(rm, msg->msg_iov, payload_len);
977 goto out; 977 if (ret)
978 goto out;
979 }
980 rm->data.op_active = 1;
978 981
979 rm->m_daddr = daddr; 982 rm->m_daddr = daddr;
980 983