]> err.no Git - linux-2.6/blobdiff - net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
[linux-2.6] / net / sunrpc / xprtrdma / svc_rdma_recvfrom.c
index 21a1e625ef0305837585eaa43d4405b00bf0f66e..06ab4841537b236a395377098fb073ca3060a549 100644 (file)
@@ -306,6 +306,8 @@ static int rdma_read_xdr(struct svcxprt_rdma *xprt,
        ch_sge_ary = (struct chunk_sge *)tmp_ch_ctxt->sge;
 
        svc_rdma_rcl_chunk_counts(ch, &ch_count, &byte_count);
+       if (ch_count > RPCSVC_MAXPAGES)
+               return -EINVAL;
        sge_count = rdma_rcl_to_sge(xprt, rqstp, hdr_ctxt, rmsgp,
                                    sge, ch_sge_ary,
                                    ch_count, byte_count);
@@ -416,6 +418,7 @@ static int rdma_read_complete(struct svc_rqst *rqstp,
 
        /* XXX: What should this be? */
        rqstp->rq_prot = IPPROTO_MAX;
+       svc_xprt_copy_addrs(rqstp, rqstp->rq_xprt);
 
        ret = rqstp->rq_arg.head[0].iov_len
                + rqstp->rq_arg.page_len
@@ -496,7 +499,7 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
        /* If the request is invalid, reply with an error */
        if (len < 0) {
                if (len == -ENOSYS)
-                       (void)svc_rdma_send_error(rdma_xprt, rmsgp, ERR_VERS);
+                       svc_rdma_send_error(rdma_xprt, rmsgp, ERR_VERS);
                goto close_out;
        }