From: Thomas Hellstrom <thellstrom@vmware.com>
To: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/ttm: fix ttm_bo_add_ttm(user) failure path
Date: Tue, 23 Aug 2011 08:13:08 +0200 [thread overview]
Message-ID: <4E5344F4.9060900@vmware.com> (raw)
In-Reply-To: <20110822211757.GB3098@joi.lan>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
On 08/22/2011 11:17 PM, Marcin Slusarz wrote:
> ttm_tt_destroy kfrees passed object, so we need to nullify
> a reference to it.
>
> Signed-off-by: Marcin Slusarz<marcin.slusarz@gmail.com>
> Cc: stable@kernel.org
> ---
> drivers/gpu/drm/ttm/ttm_bo.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 251df77..2e8f929 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -353,8 +353,10 @@ static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc)
>
> ret = ttm_tt_set_user(bo->ttm, current,
> bo->buffer_start, bo->num_pages);
> - if (unlikely(ret != 0))
> + if (unlikely(ret != 0)) {
> ttm_tt_destroy(bo->ttm);
> + bo->ttm = NULL;
> + }
> break;
> default:
> printk(KERN_ERR TTM_PFX "Illegal buffer object type\n");
>
prev parent reply other threads:[~2011-08-23 6:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 21:17 [PATCH] drm/ttm: fix ttm_bo_add_ttm(user) failure path Marcin Slusarz
2011-08-23 6:13 ` Thomas Hellstrom [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=4E5344F4.9060900@vmware.com \
--to=thellstrom@vmware.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=marcin.slusarz@gmail.com \
/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