diff options
author | Andy Grover <andy.grover@oracle.com> | 2010-10-28 11:40:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-30 19:34:16 -0400 |
commit | a09f69c49b84b161ebd4dd09d3cce1b68297f1d3 (patch) | |
tree | 295290736f0a4dbbfc495e035adbbe0cafe447e4 /net | |
parent | 1b1f693d7ad6d193862dcb1118540a030c5e761f (diff) |
RDS: Return -EINVAL if rds_rdma_pages returns an error
rds_cmsg_rdma_args would still return success even if rds_rdma_pages
returned an error (or overflowed).
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/rds/rdma.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 0df02c8a8533..d0ba2ca3b714 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c | |||
@@ -554,8 +554,10 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, | |||
554 | } | 554 | } |
555 | 555 | ||
556 | nr_pages = rds_rdma_pages(args); | 556 | nr_pages = rds_rdma_pages(args); |
557 | if (nr_pages < 0) | 557 | if (nr_pages < 0) { |
558 | ret = -EINVAL; | ||
558 | goto out; | 559 | goto out; |
560 | } | ||
559 | 561 | ||
560 | pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL); | 562 | pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL); |
561 | if (!pages) { | 563 | if (!pages) { |