From: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH wip/dl-for-next] RDMA/bnxt_re: Fix kbuild error
Date: Thu, 18 Jan 2018 21:15:32 +0200 [thread overview]
Message-ID: <20180118191531.GA16234@yuvallap> (raw)
In-Reply-To: <1516288665-11055-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
On Thu, Jan 18, 2018 at 10:17:45AM -0500, Devesh Sharma wrote:
> Fix for following build failure
>
> drivers/infiniband/hw/bnxt_re/ib_verbs.c:3402:7-14: ERROR: reference
> preceded by free on line 3375
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git wip/dl-for-next
> head: d47f6fe6736ed3ecb39cd69fe26e3518f199eecd
> commit: cb8a852e09c1dc8e47af741714063acf9c4d115c [3/28] RDMA/bnxt_re: Add support for MRs with Huge pages
> :::::: branch date: 4 hours ago
> :::::: commit date: 15 hours ago
>
> >> drivers/infiniband/hw/bnxt_re/ib_verbs.c:3402:7-14: ERROR: reference preceded by free on line 3375
>
> git remote add rdma-rdma https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git
> git remote update rdma-rdma
> git checkout cb8a852e09c1dc8e47af741714063acf9c4d115c
> vim +3402 drivers/infiniband/hw/bnxt_re/ib_verbs.c
>
> Signed-off-by: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/infiniband/hw/bnxt_re/ib_verbs.c | 17 +++++++----------
> 1 file changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> index 7220322..9b8fa77 100644
> --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> @@ -3355,10 +3355,8 @@ int bnxt_re_dereg_mr(struct ib_mr *ib_mr)
> int rc;
>
> rc = bnxt_qplib_free_mrw(&rdev->qplib_res, &mr->qplib_mr);
> - if (rc) {
> + if (rc)
> dev_err(rdev_to_dev(rdev), "Dereg MR failed: %#x\n", rc);
> - return rc;
> - }
>
> if (mr->pages) {
> rc = bnxt_qplib_free_fast_reg_page_list(&rdev->qplib_res,
> @@ -3421,7 +3419,7 @@ struct ib_mr *bnxt_re_alloc_mr(struct ib_pd *ib_pd, enum ib_mr_type type,
>
> rc = bnxt_qplib_alloc_mrw(&rdev->qplib_res, &mr->qplib_mr);
> if (rc)
> - goto fail;
> + goto bail;
>
> mr->ib_mr.lkey = mr->qplib_mr.lkey;
> mr->ib_mr.rkey = mr->ib_mr.lkey;
> @@ -3443,9 +3441,10 @@ struct ib_mr *bnxt_re_alloc_mr(struct ib_pd *ib_pd, enum ib_mr_type type,
> return &mr->ib_mr;
>
> fail_mr:
> - bnxt_qplib_free_mrw(&rdev->qplib_res, &mr->qplib_mr);
> -fail:
> kfree(mr->pages);
> +fail:
> + bnxt_qplib_free_mrw(&rdev->qplib_res, &mr->qplib_mr);
> +bail:
> kfree(mr);
> return ERR_PTR(rc);
> }
> @@ -3595,22 +3594,20 @@ struct ib_mr *bnxt_re_reg_user_mr(struct ib_pd *ib_pd, u64 start, u64 length,
> pbl_tbl = kcalloc(umem_pgs, sizeof(u64 *), GFP_KERNEL);
> if (!pbl_tbl) {
> rc = -ENOMEM;
> - goto free_mrw;
> + goto free_umem;
> }
>
> page_shift = umem->page_shift;
>
> if (!bnxt_re_page_size_ok(page_shift)) {
> dev_err(rdev_to_dev(rdev), "umem page size unsupported!");
> - kfree(pbl_tbl);
> rc = -EFAULT;
> - goto free_umem;
> + goto fail;
> }
>
> if (!umem->hugetlb && length > BNXT_RE_MAX_MR_SIZE_LOW) {
> dev_err(rdev_to_dev(rdev), "Requested MR Sz:%llu Max sup:%llu",
> length, (u64)BNXT_RE_MAX_MR_SIZE_LOW);
> - kfree(pbl_tbl);
> rc = -EINVAL;
> goto fail;
> }
> --
> 1.8.3.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2018-01-18 19:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-18 15:17 [PATCH wip/dl-for-next] RDMA/bnxt_re: Fix kbuild error Devesh Sharma
[not found] ` <1516288665-11055-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2018-01-18 15:19 ` Devesh Sharma
[not found] ` <CANjDDBgnhRuroVEfGJ=gF9=dS47w7pcQh5hZsF=p5iF6mxmX9g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-18 19:54 ` Doug Ledford
[not found] ` <1516305246.3403.301.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-01-19 5:15 ` Devesh Sharma
2018-01-18 19:15 ` Yuval Shaia [this message]
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=20180118191531.GA16234@yuvallap \
--to=yuval.shaia-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
--cc=devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.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.