RDMA/uverbs: Fix post send success return value in case of error

If get QP object fails 'ret' must be assigned with a proper error code.

Fixes: 9a0738575f ("RDMA/uverbs: Use uverbs_response() for remaining response copying")
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Gal Pressman 2019-01-07 13:36:56 +02:00 committed by Jason Gunthorpe
parent bfeffd1552
commit f687ccea10
1 changed files with 3 additions and 1 deletions

View File

@ -2012,8 +2012,10 @@ static int ib_uverbs_post_send(struct uverbs_attr_bundle *attrs)
return -ENOMEM; return -ENOMEM;
qp = uobj_get_obj_read(qp, UVERBS_OBJECT_QP, cmd.qp_handle, attrs); qp = uobj_get_obj_read(qp, UVERBS_OBJECT_QP, cmd.qp_handle, attrs);
if (!qp) if (!qp) {
ret = -EINVAL;
goto out; goto out;
}
is_ud = qp->qp_type == IB_QPT_UD; is_ud = qp->qp_type == IB_QPT_UD;
sg_ind = 0; sg_ind = 0;