dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Damien Lespiau <damien.lespiau@intel.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] intel: Don't leak the test page in an has_userptr() error path
Date: Fri, 19 Sep 2014 14:31:56 +0100	[thread overview]
Message-ID: <541C304C.8030802@linux.intel.com> (raw)
In-Reply-To: <1410957471-11375-1-git-send-email-damien.lespiau@intel.com>


Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

On 09/17/2014 01:37 PM, Damien Lespiau wrote:
> When handling the error on GEM_CLOSE, we weren't freeing the allocated
> page. Plug that.
>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>   intel/intel_bufmgr_gem.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
> index f378e5c..ce35bd4 100644
> --- a/intel/intel_bufmgr_gem.c
> +++ b/intel/intel_bufmgr_gem.c
> @@ -3383,9 +3383,8 @@ retry:
>
>   	close_bo.handle = userptr.handle;
>   	ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_CLOSE, &close_bo);
> -	if (ret == 0) {
> -		free(ptr);
> -	} else {
> +	free(ptr);
> +	if (ret) {
>   		fprintf(stderr, "Failed to release test userptr object! (%d) "
>   				"i915 kernel driver may not be sane!\n", errno);
>   		return false;
>

  reply	other threads:[~2014-09-19 13:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-17 12:37 [PATCH] intel: Don't leak the test page in an has_userptr() error path Damien Lespiau
2014-09-19 13:31 ` Tvrtko Ursulin [this message]
2014-09-19 13:37   ` Damien Lespiau

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=541C304C.8030802@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=damien.lespiau@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.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).