netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yuval Basson <ybason@marvell.com>
To: David Miller <davem@davemloft.net>
Cc: Michal Kalderon <mkalderon@marvell.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: [EXT] Re: [PATCH net-next,v2 2/2] qed: Add XRC to RoCE
Date: Wed, 20 May 2020 21:20:53 +0000	[thread overview]
Message-ID: <DM5PR18MB1387960C6A5D7E792A478DF9D0B60@DM5PR18MB1387.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20200519.152335.968463052378721004.davem@davemloft.net>

> From: Yuval Basson <ybason@marvell.com>
> Date: Tue, 19 May 2020 23:51:26 +0300
> 
> > @@ -1748,24 +1839,26 @@ static int qed_rdma_modify_srq(void
> *rdma_cxt,
> >  	u16 opaque_fid, srq_id;
> >  	struct qed_bmap *bmap;
> >  	u32 returned_id;
> > +	u16 offset;
> >  	int rc;
> >
> > -	bmap = &p_hwfn->p_rdma_info->srq_map;
> > +	bmap = qed_rdma_get_srq_bmap(p_hwfn, in_params->is_xrc);
> >  	spin_lock_bh(&p_hwfn->p_rdma_info->lock);
> >  	rc = qed_rdma_bmap_alloc_id(p_hwfn, bmap, &returned_id);
> >  	spin_unlock_bh(&p_hwfn->p_rdma_info->lock);
> >
> >  	if (rc) {
> > -		DP_NOTICE(p_hwfn, "failed to allocate srq id\n");
> > +		DP_NOTICE(p_hwfn,
> > +			  "failed to allocate xrc/srq id (is_xrc=%u)\n",
> > +			  in_params->is_xrc);
> >  		return rc;
> >  	}
> >
> > -	elem_type = QED_ELEM_SRQ;
> > +	elem_type = (in_params->is_xrc) ? (QED_ELEM_XRC_SRQ) :
> (QED_ELEM_SRQ);
> >  	rc = qed_cxt_dynamic_ilt_alloc(p_hwfn, elem_type, returned_id);
> >  	if (rc)
> >  		goto err;
> 
> This "if (rc)" error path will leak 'returned_id' won't it?
I don't think so.. this allocation is not part of this patch. It is handled here - 
err:
        spin_lock_bh(&p_hwfn->p_rdma_info->lock);
        qed_bmap_release_id(p_hwfn, bmap, returned_id);
        spin_unlock_bh(&p_hwfn->p_rdma_info->lock);

  reply	other threads:[~2020-05-20 21:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 20:51 [PATCH net-next,v2 0/2] qed: Add xrc core support for RoCE Yuval Basson
2020-05-19 20:51 ` [PATCH net-next,v2 1/2] qed: changes to ILT to support XRC Yuval Basson
2020-05-19 20:51 ` [PATCH net-next,v2 2/2] qed: Add XRC to RoCE Yuval Basson
2020-05-19 22:23   ` David Miller
2020-05-20 21:20     ` Yuval Basson [this message]
2020-05-22  0:08 ` [PATCH net-next,v2 0/2] qed: Add xrc core support for RoCE David Miller

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=DM5PR18MB1387960C6A5D7E792A478DF9D0B60@DM5PR18MB1387.namprd18.prod.outlook.com \
    --to=ybason@marvell.com \
    --cc=davem@davemloft.net \
    --cc=mkalderon@marvell.com \
    --cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).