aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDoug Ledford <dledford@redhat.com>2018-03-09 18:07:46 -0500
committerDoug Ledford <dledford@redhat.com>2018-03-09 18:07:46 -0500
commit212a0cbc5670c6dd7be74e17168fbf6d9bd8473a (patch)
tree4f47acbdae9705f43705fde50739535e5497aedd /drivers
parenta5880b84430316e3e1c1f5d23aa32ec6000cc717 (diff)
Revert "RDMA/mlx5: Fix integer overflow while resizing CQ"
The original commit of this patch has a munged log message that is missing several of the tags the original author intended to be on the patch. This was due to patchworks misinterpreting a cut-n-paste separator line as an end of message line and munging the mbox that was used to import the patch: https://patchwork.kernel.org/patch/10264089/ The original patch will be reapplied with a fixed commit message so the proper tags are applied. This reverts commit aa0de36a40f446f5a21a7c1e677b98206e242edb. Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/mlx5/cq.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
index 15457c9569a7..b5cfdaa9c7c8 100644
--- a/drivers/infiniband/hw/mlx5/cq.c
+++ b/drivers/infiniband/hw/mlx5/cq.c
@@ -1178,12 +1178,7 @@ static int resize_user(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq,
1178 if (ucmd.reserved0 || ucmd.reserved1) 1178 if (ucmd.reserved0 || ucmd.reserved1)
1179 return -EINVAL; 1179 return -EINVAL;
1180 1180
1181 /* check multiplication overflow */ 1181 umem = ib_umem_get(context, ucmd.buf_addr, entries * ucmd.cqe_size,
1182 if (ucmd.cqe_size && SIZE_MAX / ucmd.cqe_size <= entries - 1)
1183 return -EINVAL;
1184
1185 umem = ib_umem_get(context, ucmd.buf_addr,
1186 (size_t)ucmd.cqe_size * entries,
1187 IB_ACCESS_LOCAL_WRITE, 1); 1182 IB_ACCESS_LOCAL_WRITE, 1);
1188 if (IS_ERR(umem)) { 1183 if (IS_ERR(umem)) {
1189 err = PTR_ERR(umem); 1184 err = PTR_ERR(umem);