Message ID | 1489051243-27108-1-git-send-email-yanjun.zhu@oracle.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
On 03/09/2017 10:20 AM, Zhu Yanjun wrote: > The function ib_dealloc_fmr will never be called. As such, it should > be removed. > > Cc: Joe Jin <joe.jin@oracle.com> > Cc: Junxiao Bi <junxiao.bi@oracle.com> > Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com> > --- Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
On Thu, Mar 09, 2017 at 04:20:43AM -0500, Zhu Yanjun wrote: > The function ib_dealloc_fmr will never be called. As such, it should > be removed. > > Cc: Joe Jin <joe.jin@oracle.com> > Cc: Junxiao Bi <junxiao.bi@oracle.com> > Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com> > --- > Change from v1 to v2: > remove ibmr NULL test. > > net/rds/ib_fmr.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/net/rds/ib_fmr.c b/net/rds/ib_fmr.c > index 4fe8f4f..249ae1c 100644 > --- a/net/rds/ib_fmr.c > +++ b/net/rds/ib_fmr.c > @@ -78,12 +78,9 @@ struct rds_ib_mr *rds_ib_alloc_fmr(struct rds_ib_device *rds_ibdev, int npages) > return ibmr; > > out_no_cigar: > - if (ibmr) { > - if (fmr->fmr) > - ib_dealloc_fmr(fmr->fmr); > - kfree(ibmr); > - } > + kfree(ibmr); > atomic_dec(&pool->item_count); > + Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com> > return ERR_PTR(err); > } > > -- > 2.7.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 3/9/2017 1:20 AM, Zhu Yanjun wrote: > The function ib_dealloc_fmr will never be called. As such, it should > be removed. > > Cc: Joe Jin <joe.jin@oracle.com> > Cc: Junxiao Bi <junxiao.bi@oracle.com> > Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com> > --- > Change from v1 to v2: > remove ibmr NULL test. > While posting updates, please post entire series and also give some time between two posts. > net/rds/ib_fmr.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/net/rds/ib_fmr.c b/net/rds/ib_fmr.c > index 4fe8f4f..249ae1c 100644 > --- a/net/rds/ib_fmr.c > +++ b/net/rds/ib_fmr.c > @@ -78,12 +78,9 @@ struct rds_ib_mr *rds_ib_alloc_fmr(struct rds_ib_device *rds_ibdev, int npages) > return ibmr; > > out_no_cigar: > - if (ibmr) { > - if (fmr->fmr) > - ib_dealloc_fmr(fmr->fmr); > - kfree(ibmr); > - } > + kfree(ibmr); > atomic_dec(&pool->item_count); > + No need of the extra line here. > return ERR_PTR(err); > } > > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/rds/ib_fmr.c b/net/rds/ib_fmr.c index 4fe8f4f..249ae1c 100644 --- a/net/rds/ib_fmr.c +++ b/net/rds/ib_fmr.c @@ -78,12 +78,9 @@ struct rds_ib_mr *rds_ib_alloc_fmr(struct rds_ib_device *rds_ibdev, int npages) return ibmr; out_no_cigar: - if (ibmr) { - if (fmr->fmr) - ib_dealloc_fmr(fmr->fmr); - kfree(ibmr); - } + kfree(ibmr); atomic_dec(&pool->item_count); + return ERR_PTR(err); }
The function ib_dealloc_fmr will never be called. As such, it should be removed. Cc: Joe Jin <joe.jin@oracle.com> Cc: Junxiao Bi <junxiao.bi@oracle.com> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com> --- Change from v1 to v2: remove ibmr NULL test. net/rds/ib_fmr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)