aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/uverbs_cmd.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-21 17:22:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-21 17:22:05 -0400
commitbb236dbeea8181c6733e6d34a53bfef9c8ef4e95 (patch)
tree2d71f98dcc5676beb4e6029462d60be0ff6ebbc1 /drivers/infiniband/core/uverbs_cmd.c
parent24a1635a41bccb5cc426eaef8b88c7e0961ef6bb (diff)
parenta62ab66b13a0f9bcb17b7b761f6670941ed5cd62 (diff)
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
Pull more rdma fixes from Doug Ledford: "As per my previous pull request, there were two drivers that each had a rather large number of legitimate fixes still to be sent. As it turned out, I also missed a reasonably large set of fixes from one person across the stack that are all important fixes. All in all, the bnxt_re, i40iw, and Dan Carpenter are 3/4 to 2/3rds of this pull request. There were some other random fixes that I didn't send in the last pull request that I added to this one. This catches the rdma stack up to the fixes from up to about the beginning of this week. Any more fixes I'll wait and batch up later in the -rc cycle. This will give us a good base to start with for basing a for-next branch on -rc2. Summary: - i40iw fixes - bnxt_re fixes - Dan Carpenter bugfixes across stack - ten more random fixes, no more than two from any one person" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (37 commits) RDMA/core: Initialize port_num in qp_attr RDMA/uverbs: Fix the check for port number IB/cma: Fix reference count leak when no ipv4 addresses are set RDMA/iser: don't send an rkey if all data is written as immadiate-data rxe: fix broken receive queue draining RDMA/qedr: Prevent memory overrun in verbs' user responses iw_cxgb4: don't use WR keys/addrs for 0 byte reads IB/mlx4: Fix CM REQ retries in paravirt mode IB/rdmavt: Setting of QP timeout can overflow jiffies computation IB/core: Fix sparse warnings RDMA/bnxt_re: Fix the value reported for local ack delay RDMA/bnxt_re: Report MISSED_EVENTS in req_notify_cq RDMA/bnxt_re: Fix return value of poll routine RDMA/bnxt_re: Enable atomics only if host bios supports RDMA/bnxt_re: Specify RDMA component when allocating stats context RDMA/bnxt_re: Fixed the max_rd_atomic support for initiator and destination QP RDMA/bnxt_re: Report supported value to IB stack in query_device RDMA/bnxt_re: Do not free the ctx_tbl entry if delete GID fails RDMA/bnxt_re: Fix WQE Size posted to HW to prevent it from throwing error RDMA/bnxt_re: Free doorbell page index (DPI) during dealloc ucontext ...
Diffstat (limited to 'drivers/infiniband/core/uverbs_cmd.c')
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 3f55d18a3791..2c98533a0203 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -1296,7 +1296,6 @@ ssize_t ib_uverbs_destroy_cq(struct ib_uverbs_file *file,
1296 struct ib_uobject *uobj; 1296 struct ib_uobject *uobj;
1297 struct ib_cq *cq; 1297 struct ib_cq *cq;
1298 struct ib_ucq_object *obj; 1298 struct ib_ucq_object *obj;
1299 struct ib_uverbs_event_queue *ev_queue;
1300 int ret = -EINVAL; 1299 int ret = -EINVAL;
1301 1300
1302 if (copy_from_user(&cmd, buf, sizeof cmd)) 1301 if (copy_from_user(&cmd, buf, sizeof cmd))
@@ -1313,7 +1312,6 @@ ssize_t ib_uverbs_destroy_cq(struct ib_uverbs_file *file,
1313 */ 1312 */
1314 uverbs_uobject_get(uobj); 1313 uverbs_uobject_get(uobj);
1315 cq = uobj->object; 1314 cq = uobj->object;
1316 ev_queue = cq->cq_context;
1317 obj = container_of(cq->uobject, struct ib_ucq_object, uobject); 1315 obj = container_of(cq->uobject, struct ib_ucq_object, uobject);
1318 1316
1319 memset(&resp, 0, sizeof(resp)); 1317 memset(&resp, 0, sizeof(resp));
@@ -1935,7 +1933,8 @@ static int modify_qp(struct ib_uverbs_file *file,
1935 goto out; 1933 goto out;
1936 } 1934 }
1937 1935
1938 if (!rdma_is_port_valid(qp->device, cmd->base.port_num)) { 1936 if ((cmd->base.attr_mask & IB_QP_PORT) &&
1937 !rdma_is_port_valid(qp->device, cmd->base.port_num)) {
1939 ret = -EINVAL; 1938 ret = -EINVAL;
1940 goto release_qp; 1939 goto release_qp;
1941 } 1940 }
@@ -2088,7 +2087,6 @@ ssize_t ib_uverbs_destroy_qp(struct ib_uverbs_file *file,
2088 struct ib_uverbs_destroy_qp cmd; 2087 struct ib_uverbs_destroy_qp cmd;
2089 struct ib_uverbs_destroy_qp_resp resp; 2088 struct ib_uverbs_destroy_qp_resp resp;
2090 struct ib_uobject *uobj; 2089 struct ib_uobject *uobj;
2091 struct ib_qp *qp;
2092 struct ib_uqp_object *obj; 2090 struct ib_uqp_object *obj;
2093 int ret = -EINVAL; 2091 int ret = -EINVAL;
2094 2092
@@ -2102,7 +2100,6 @@ ssize_t ib_uverbs_destroy_qp(struct ib_uverbs_file *file,
2102 if (IS_ERR(uobj)) 2100 if (IS_ERR(uobj))
2103 return PTR_ERR(uobj); 2101 return PTR_ERR(uobj);
2104 2102
2105 qp = uobj->object;
2106 obj = container_of(uobj, struct ib_uqp_object, uevent.uobject); 2103 obj = container_of(uobj, struct ib_uqp_object, uevent.uobject);
2107 /* 2104 /*
2108 * Make sure we don't free the memory in remove_commit as we still 2105 * Make sure we don't free the memory in remove_commit as we still
@@ -3004,7 +3001,6 @@ int ib_uverbs_ex_destroy_wq(struct ib_uverbs_file *file,
3004{ 3001{
3005 struct ib_uverbs_ex_destroy_wq cmd = {}; 3002 struct ib_uverbs_ex_destroy_wq cmd = {};
3006 struct ib_uverbs_ex_destroy_wq_resp resp = {}; 3003 struct ib_uverbs_ex_destroy_wq_resp resp = {};
3007 struct ib_wq *wq;
3008 struct ib_uobject *uobj; 3004 struct ib_uobject *uobj;
3009 struct ib_uwq_object *obj; 3005 struct ib_uwq_object *obj;
3010 size_t required_cmd_sz; 3006 size_t required_cmd_sz;
@@ -3038,7 +3034,6 @@ int ib_uverbs_ex_destroy_wq(struct ib_uverbs_file *file,
3038 if (IS_ERR(uobj)) 3034 if (IS_ERR(uobj))
3039 return PTR_ERR(uobj); 3035 return PTR_ERR(uobj);
3040 3036
3041 wq = uobj->object;
3042 obj = container_of(uobj, struct ib_uwq_object, uevent.uobject); 3037 obj = container_of(uobj, struct ib_uwq_object, uevent.uobject);
3043 /* 3038 /*
3044 * Make sure we don't free the memory in remove_commit as we still 3039 * Make sure we don't free the memory in remove_commit as we still
@@ -3728,10 +3723,8 @@ ssize_t ib_uverbs_destroy_srq(struct ib_uverbs_file *file,
3728 struct ib_uverbs_destroy_srq cmd; 3723 struct ib_uverbs_destroy_srq cmd;
3729 struct ib_uverbs_destroy_srq_resp resp; 3724 struct ib_uverbs_destroy_srq_resp resp;
3730 struct ib_uobject *uobj; 3725 struct ib_uobject *uobj;
3731 struct ib_srq *srq;
3732 struct ib_uevent_object *obj; 3726 struct ib_uevent_object *obj;
3733 int ret = -EINVAL; 3727 int ret = -EINVAL;
3734 enum ib_srq_type srq_type;
3735 3728
3736 if (copy_from_user(&cmd, buf, sizeof cmd)) 3729 if (copy_from_user(&cmd, buf, sizeof cmd))
3737 return -EFAULT; 3730 return -EFAULT;
@@ -3741,9 +3734,7 @@ ssize_t ib_uverbs_destroy_srq(struct ib_uverbs_file *file,
3741 if (IS_ERR(uobj)) 3734 if (IS_ERR(uobj))
3742 return PTR_ERR(uobj); 3735 return PTR_ERR(uobj);
3743 3736
3744 srq = uobj->object;
3745 obj = container_of(uobj, struct ib_uevent_object, uobject); 3737 obj = container_of(uobj, struct ib_uevent_object, uobject);
3746 srq_type = srq->srq_type;
3747 /* 3738 /*
3748 * Make sure we don't free the memory in remove_commit as we still 3739 * Make sure we don't free the memory in remove_commit as we still
3749 * needs the uobject memory to create the response. 3740 * needs the uobject memory to create the response.