aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/uverbs_cmd.c
diff options
context:
space:
mode:
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.