On 10/28/19 12:08 PM, Jason Gunthorpe wrote: > On Mon, Oct 28, 2019 at 06:14:52PM +0000, Adit Ranadive wrote: >> >> + if (!qp->is_kernel) { >> + if (udata->outlen >= sizeof(qp_resp)) { >> + qp_resp.qpn = qp->ibqp.qp_num; >> + qp_resp.qp_handle = qp->qp_handle; >> + >> + if (ib_copy_to_udata(udata, &qp_resp, >> + min(udata->outlen, >> + sizeof(qp_resp)))) { >> + dev_warn(&dev->pdev->dev, >> + "failed to copy back udata\n"); >> + __pvrdma_destroy_qp(dev, qp); >> + return ERR_PTR(-EINVAL); >> + } >> + } >> + } > > This is just supposed to be like this: > > + if (udata) { > + qp_resp.qpn = qp->ibqp.qp_num; > + qp_resp.qp_handle = qp->qp_handle; > + > + if (ib_copy_to_udata(udata, &qp_resp, > + min(udata->outlen, sizeof(qp_resp)))) { > + dev_warn(&dev->pdev->dev, > + "failed to copy back udata\n"); > + __pvrdma_destroy_qp(dev, qp); > + return ERR_PTR(-EINVAL); > > > I fixed it > > Applied to for-next > Makes sense. Thanks! > Thanks, > Jason >