From: "Steve Wise" <swise@opengridcomputing.com>
To: "'Nicholas Krause'" <xerofoify@gmail.com>, <swise@chelsio.com>
Cc: <dledford@redhat.com>, <sean.hefty@intel.com>,
<hal.rosenstock@gmail.com>, <linux-rdma@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] infiniband:cxgb4:Fix incorrect return statement in the function c4iw_destroy_cq
Date: Tue, 1 Sep 2015 09:58:41 -0500 [thread overview]
Message-ID: <002701d0e4c6$b0d1c760$12755620$@opengridcomputing.com> (raw)
In-Reply-To: <1440965510-6724-1-git-send-email-xerofoify@gmail.com>
> -----Original Message-----
> From: Nicholas Krause [mailto:xerofoify@gmail.com]
> Sent: Sunday, August 30, 2015 3:12 PM
> To: swise@chelsio.com
> Cc: dledford@redhat.com; sean.hefty@intel.com; hal.rosenstock@gmail.com; linux-rdma@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] infiniband:cxgb4:Fix incorrect return statement in the function c4iw_destroy_cq
>
> This fixes the incorrect return statement at the end of the function
> c4iw_destroy_cq's body that returns zero to instead correctly return
> the return value of the call to the function destroy_cq as all callers
> of c4iw_destroy_cq should be signaled when this call fails in order
> for them to handle it in their own intended error paths.
>
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
> drivers/infiniband/hw/cxgb4/cq.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
> index 92d5183..4f7af20 100644
> --- a/drivers/infiniband/hw/cxgb4/cq.c
> +++ b/drivers/infiniband/hw/cxgb4/cq.c
> @@ -848,6 +848,7 @@ int c4iw_destroy_cq(struct ib_cq *ib_cq)
> {
> struct c4iw_cq *chp;
> struct c4iw_ucontext *ucontext;
> + int ret;
>
> PDBG("%s ib_cq %p\n", __func__, ib_cq);
> chp = to_c4iw_cq(ib_cq);
> @@ -858,10 +859,10 @@ int c4iw_destroy_cq(struct ib_cq *ib_cq)
>
> ucontext = ib_cq->uobject ? to_c4iw_ucontext(ib_cq->uobject->context)
> : NULL;
> - destroy_cq(&chp->rhp->rdev, &chp->cq,
> - ucontext ? &ucontext->uctx : &chp->cq.rdev->uctx);
> + ret = destroy_cq(&chp->rhp->rdev, &chp->cq,
> + ucontext ? &ucontext->uctx : &chp->cq.rdev->uctx);
> kfree(chp);
> - return 0;
> + return ret;
> }
The SW CQ is destroyed regardless of any errors returned by destroy_cq(). So c4iw_destroy_cq() shouldn't return non-zero since it
is freeing the CQ memory. I think the correct change here is to only kfree(chp) if destroy_cq() returns 0.
Steve.
>
> struct ib_cq *c4iw_create_cq(struct ib_device *ibdev,
> --
> 2.1.4
parent reply other threads:[~2015-09-01 14:58 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1440965510-6724-1-git-send-email-xerofoify@gmail.com>]
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='002701d0e4c6$b0d1c760$12755620$@opengridcomputing.com' \
--to=swise@opengridcomputing.com \
--cc=dledford@redhat.com \
--cc=hal.rosenstock@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sean.hefty@intel.com \
--cc=swise@chelsio.com \
--cc=xerofoify@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®