linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Aditya Pakki <pakki001@umn.edu>,
	Dennis Dalessandro <dennis.dalessandro@intel.com>,
	linux-rdma@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Kangjie Lu <kjlu@umn.edu>,
	Mike Marciniszyn <mike.marciniszyn@intel.com>,
	Qiushi Wu <wu000273@umn.edu>
Subject: Re: [PATCH] RDMA/rvt: Improve exception handling in rvt_create_qp()
Date: Sun, 14 Jun 2020 20:18:27 +0200	[thread overview]
Message-ID: <308f471c-8294-157f-3e3d-4a7f6473381e@web.de> (raw)
In-Reply-To: <5d99dfe5-67ed-00d2-c2da-77058fb770c6@web.de>

> …
>> +++ b/drivers/infiniband/sw/rdmavt/qp.c
>> @@ -1203,6 +1203,7 @@  struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,
>>  			qp->s_flags = RVT_S_SIGNAL_REQ_WR;
>>  		err = alloc_ud_wq_attr(qp, rdi->dparms.node);
>>  		if (err) {
>> +			rvt_free_rq(&qp->r_rq);
>>  			ret = (ERR_PTR(err));
>>  			goto bail_driver_priv;
>>  		}
>
> How do you think about the following code variant with the addition
> of a jump target?
>
>  		err = alloc_ud_wq_attr(qp, rdi->dparms.node);
>  		if (err) {
>  			ret = (ERR_PTR(err));
> -			goto bail_driver_priv;
> +			goto bail_free_rq;
>  		}
>
> …
>
>  bail_rq_wq:
> -	rvt_free_rq(&qp->r_rq);
>  	free_ud_wq_attr(qp);
> +
> +bail_free_rq:
> +	rvt_free_rq(&qp->r_rq);
>
>  bail_driver_priv:

The improvement of affected implementation details is continued with
another update suggestion.

RDMA/rvt: Fix potential memory leak caused by rvt_alloc_rq
https://lore.kernel.org/linux-rdma/20200614041148.131983-1-pakki001@umn.edu/
https://lore.kernel.org/patchwork/patch/1255709/

Regards,
Markus

      parent reply	other threads:[~2020-06-14 18:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-13  7:15 [PATCH] RDMA/rvt: Improve exception handling in rvt_create_qp() Markus Elfring
2020-06-14  7:15 ` Greg KH
2020-06-14 18:18 ` Markus Elfring [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=308f471c-8294-157f-3e3d-4a7f6473381e@web.de \
    --to=markus.elfring@web.de \
    --cc=dennis.dalessandro@intel.com \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mike.marciniszyn@intel.com \
    --cc=pakki001@umn.edu \
    --cc=wu000273@umn.edu \
    /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).