qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yuval Shaia <yuval.shaia@oracle.com>
To: P J P <ppandit@redhat.com>
Cc: Qemu Developers <qemu-devel@nongnu.org>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Li Qiang <liq3ea@163.com>,
	Prasad J Pandit <pjp@fedoraproject.org>,
	yuval.shaia@oracle.com
Subject: Re: [Qemu-devel] [PATCH] pvrdma: release device resources in case of an error
Date: Wed, 12 Dec 2018 21:08:08 +0200	[thread overview]
Message-ID: <20181212190807.GA7372@lap1> (raw)
In-Reply-To: <20181212175817.815-1-ppandit@redhat.com>

On Wed, Dec 12, 2018 at 11:28:17PM +0530, P J P wrote:
> From: Prasad J Pandit <pjp@fedoraproject.org>
> 
> If during pvrdma device initialisation an error occurs,
> pvrdma_realize() does not release memory resources, leading
> to memory leakage.
> 
> Reported-by: Li Qiang <liq3ea@163.com>
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
> ---
>  hw/rdma/vmw/pvrdma_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c
> index 8a03ab4669..b65f8662df 100644
> --- a/hw/rdma/vmw/pvrdma_main.c
> +++ b/hw/rdma/vmw/pvrdma_main.c
> @@ -579,7 +579,7 @@ static void pvrdma_shutdown_notifier(Notifier *n, void *opaque)
>  
>  static void pvrdma_realize(PCIDevice *pdev, Error **errp)
>  {
> -    int rc;
> +    int rc = 0;
>      PVRDMADev *dev = PVRDMA_DEV(pdev);
>      Object *memdev_root;
>      bool ram_shared = false;
> @@ -655,6 +655,7 @@ static void pvrdma_realize(PCIDevice *pdev, Error **errp)
>  
>  out:
>      if (rc) {
> +        pvrdma_fini(pdev);
>          error_append_hint(errp, "Device fail to load\n");
>      }

Thanks.

Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>

>  }
> -- 
> 2.19.2
> 

      reply	other threads:[~2018-12-12 19:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 17:58 [Qemu-devel] [PATCH] pvrdma: release device resources in case of an error P J P
2018-12-12 19:08 ` 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=20181212190807.GA7372@lap1 \
    --to=yuval.shaia@oracle.com \
    --cc=liq3ea@163.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=pjp@fedoraproject.org \
    --cc=ppandit@redhat.com \
    --cc=qemu-devel@nongnu.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).