Skip to content

Commit

Permalink
RDS: Return -EINVAL if rds_rdma_pages returns an error
Browse files Browse the repository at this point in the history
rds_cmsg_rdma_args would still return success even if rds_rdma_pages
returned an error (or overflowed).

Signed-off-by: Andy Grover <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Andy Grover authored and davem330 committed Oct 30, 2010
1 parent 1b1f693 commit a09f69c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/rds/rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,10 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
}

nr_pages = rds_rdma_pages(args);
if (nr_pages < 0)
if (nr_pages < 0) {
ret = -EINVAL;
goto out;
}

pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL);
if (!pages) {
Expand Down

0 comments on commit a09f69c

Please sign in to comment.