[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM5PR18MB1387960C6A5D7E792A478DF9D0B60@DM5PR18MB1387.namprd18.prod.outlook.com>
Date: Wed, 20 May 2020 21:20:53 +0000
From: Yuval Basson <ybason@...vell.com>
To: David Miller <davem@...emloft.net>
CC: Michal Kalderon <mkalderon@...vell.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [EXT] Re: [PATCH net-next,v2 2/2] qed: Add XRC to RoCE
> From: Yuval Basson <ybason@...vell.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);
Powered by blists - more mailing lists