From: Yuval Shaia <yuval.shaia@oracle.com>
To: Kamal Heib <kamalheib1@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 3/4] hw/rdma: Modify create/destroy QP to support SRQ
Date: Mon, 1 Apr 2019 09:50:36 +0300 [thread overview]
Message-ID: <20190401065035.GA8342@lap1> (raw)
In-Reply-To: <2fc57775-8e6f-6919-f402-8c140a7b14c9@gmail.com>
> >>
> >> @@ -525,16 +539,21 @@ static int destroy_qp(PVRDMADev *dev, union pvrdma_cmd_req *req,
> >> struct pvrdma_cmd_destroy_qp *cmd = &req->destroy_qp;
> >> RdmaRmQP *qp;
> >> PvrdmaRing *ring;
> >> + uint8_t is_srq = 0;
> >>
> >> qp = rdma_rm_get_qp(&dev->rdma_dev_res, cmd->qp_handle);
> >> if (!qp) {
> >> return -EINVAL;
> >> }
> >>
> >> + if (qp->is_srq) {
> >> + is_srq = 1;
> >> + }
> >> +
> >
> > [1]
> >
> >> rdma_rm_dealloc_qp(&dev->rdma_dev_res, cmd->qp_handle);
> >
> > [2]
> >
> >>
> >> ring = (PvrdmaRing *)qp->opaque;
> >
> > [3]
> >
> >> - destroy_qp_rings(ring);
> >> + destroy_qp_rings(ring, is_srq);
> >
> > Better move the call to rdma_rm_dealloc_qp ([2]) to here and get rid of the
> > block in [1].
> >
> > In any case, the code in [3] looks like a bug to me (an existing bug), i.e.
> > qp pointer cannot be trusted after call to rdma_rm_dealloc_qp (use after
> > free).
> > What do you think?
>
> You are right, I'll rearrange the code in v3.
Thanks just please add note for that in the commit message as you are
fixing an issue not related to SRQ.
>
> >
> >>
> >> return 0;
> >> }
> >> --
> >> 2.20.1
> >>
> >>
>
next prev parent reply other threads:[~2019-04-01 6:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190326125433.475-1-kamalheib1@gmail.com>
[not found] ` <20190326125433.475-2-kamalheib1@gmail.com>
[not found] ` <20190327064431.GA3398@lap1>
2019-04-01 6:20 ` [Qemu-devel] [PATCH v2 1/4] hw/rdma: Add SRQ support to backend layer Kamal Heib
[not found] ` <20190326125433.475-3-kamalheib1@gmail.com>
[not found] ` <20190327160330.GC10207@lap1>
2019-04-01 6:22 ` [Qemu-devel] [PATCH v2 2/4] hw/rdma: Add support for managing SRQ resource Kamal Heib
[not found] ` <20190326125433.475-4-kamalheib1@gmail.com>
[not found] ` <20190327155414.GB10207@lap1>
2019-04-01 6:31 ` [Qemu-devel] [PATCH v2 3/4] hw/rdma: Modify create/destroy QP to support SRQ Kamal Heib
2019-04-01 6:50 ` Yuval Shaia [this message]
[not found] ` <20190326125433.475-5-kamalheib1@gmail.com>
[not found] ` <20190327161652.GD10207@lap1>
2019-04-01 6:35 ` [Qemu-devel] [PATCH v2 4/4] hw/pvrdma: Add support for SRQ Kamal Heib
[not found] ` <20190327161857.GE10207@lap1>
2019-04-01 6:39 ` [Qemu-devel] [PATCH v2 0/4] pvrdma: " Kamal Heib
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190401065035.GA8342@lap1 \
--to=yuval.shaia@oracle.com \
--cc=kamalheib1@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.