Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a09f69c4 authored by Andy Grover's avatar Andy Grover Committed by David S. Miller
Browse files

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: default avatarAndy Grover <andy.grover@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1b1f693d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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) {