All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Skeggs <bskeggs@redhat.com>
To: "Geyslan G. Bem" <geyslan@gmail.com>
Cc: airlied@linux.ie, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, kernel-br@googlegroups.com
Subject: Re: [PATCH] drm: nouveau: fix nvbe leakage
Date: Mon, 7 Oct 2013 18:35:29 -0400 (EDT)	[thread overview]
Message-ID: <184520834.2485938.1381185329449.JavaMail.root@redhat.com> (raw)
In-Reply-To: <1381184066-10684-1-git-send-email-geyslan@gmail.com>

----- Original Message -----
> From: "Geyslan G. Bem" <geyslan@gmail.com>
> To: airlied@linux.ie, bskeggs@redhat.com, dri-devel@lists.freedesktop.org
> Cc: linux-kernel@vger.kernel.org, kernel-br@googlegroups.com, "Geyslan G. Bem" <geyslan@gmail.com>
> Sent: Tuesday, 8 October, 2013 8:14:26 AM
> Subject: [PATCH] drm: nouveau: fix nvbe leakage
> 
> Free memory allocated to nvbe when returning NULL.
> 
> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
NACK.  ttm_dma_tt_init() calls the destructor if it fails, which frees the memory.

Ben.

> ---
>  drivers/gpu/drm/nouveau/nouveau_sgdma.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c
> b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
> index 0843ebc..af8b66d 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
> @@ -105,6 +105,9 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
>  		nvbe->ttm.ttm.func = &nv50_sgdma_backend;
>  
>  	if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page))
> +	{
> +		kfree(nvbe);
>  		return NULL;
> +	}
>  	return &nvbe->ttm.ttm;
>  }
> --
> 1.8.4
> 
> 

  reply	other threads:[~2013-10-07 22:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-07 22:14 [PATCH] drm: nouveau: fix nvbe leakage Geyslan G. Bem
2013-10-07 22:35 ` Ben Skeggs [this message]
2013-10-07 23:36   ` Felipe Pena
2013-10-07 23:39     ` Geyslan Gregório Bem
2013-10-08  1:34       ` Ben Skeggs
2013-10-08  9:15         ` Geyslan Gregório Bem

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=184520834.2485938.1381185329449.JavaMail.root@redhat.com \
    --to=bskeggs@redhat.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geyslan@gmail.com \
    --cc=kernel-br@googlegroups.com \
    --cc=linux-kernel@vger.kernel.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.