From: Chris Wilson <chris@chris-wilson.co.uk>
To: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/3] agp/intel: Destroy the scatterlist on allocation failure
Date: Tue, 27 Jul 2010 08:42:33 +0100 [thread overview]
Message-ID: <89k83a$92jplm@azsmga001.ch.intel.com> (raw)
In-Reply-To: <20100727020007.GC19248@zhen-devel.sh.intel.com>
On Tue, 27 Jul 2010 10:00:07 +0800, Zhenyu Wang <zhenyuw@linux.intel.com> wrote:
> On 2010.07.24 18:29:37 +0100, Chris Wilson wrote:
> > A side-effect of being able to use custom page allocations with the
> > sg_table is that it cannot reap the partially constructed scatterlist if
> > fails to allocate a page. So we need to call sg_free_table() ourselves
> > if sg_alloc_table() fails.
>
> Why? Doesn't sg_alloc_table() handle the failure case to call sg_free_table()
> already?
sg_alloc_table() is just a wrapper around __sg_alloc_table() that passes
in the default alloc_func. So for __sg_alloc_table() to do the cleanup we
would need to also pass in the free_func. Since it doesn't, it can't free
the partially constructed table. So to fix this we have the choice of
changing the interface (and add extra overhead to the common path) or
trivially rearrange our failure path.
--
Chris Wilson, Intel Open Source Technology Centre
next prev parent reply other threads:[~2010-07-27 7:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-24 17:29 [PATCH 1/3] drm: Cleanup after failing to create master->unique and dev->name Chris Wilson
2010-07-24 17:29 ` [PATCH 2/3] drm: Free devname along with master->unique Chris Wilson
2010-07-24 17:29 ` [PATCH 3/3] agp/intel: Destroy the scatterlist on allocation failure Chris Wilson
2010-07-27 2:00 ` Zhenyu Wang
2010-07-27 7:42 ` Chris Wilson [this message]
2010-08-02 2:26 ` Eric Anholt
2010-07-24 17:56 ` [PATCH 1/3] drm: Cleanup after failing to create master->unique and dev->name Chris Wilson
2010-07-24 18:34 ` [PATCH] " Chris Wilson
2010-08-02 0:13 ` Dave Airlie
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='89k83a$92jplm@azsmga001.ch.intel.com' \
--to=chris@chris-wilson.co.uk \
--cc=dri-devel@lists.freedesktop.org \
--cc=zhenyuw@linux.intel.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 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.