From: Ben Skeggs <skeggsb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/nouveau: fix error handling in core/core object creation functions
Date: Tue, 9 Oct 2012 10:05:15 +1000 [thread overview]
Message-ID: <20121009000515.GA19660@turiel> (raw)
In-Reply-To: <20121008225059.GD3103-OI9uyE9O0yo@public.gmane.org>
On Tue, Oct 09, 2012 at 12:50:59AM +0200, Marcin Slusarz wrote:
> On Mon, Oct 08, 2012 at 11:05:33AM +1000, Ben Skeggs wrote:
> > On Mon, Oct 08, 2012 at 12:49:31AM +0200, Marcin Slusarz wrote:
> > > Signed-off-by: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > > ---
> > > This patch relies on "drm/nouveau: remove >1 sclass support from nouveau_parent_create_".
> > >
> > > There are *many* *more* code paths without proper error handling -
> > This is *not* a bug. An object's constructor should be called via
> > nouveau_object_ctor(), which has the semantics that the constructor
> > returns and error *and* a pointer returned via pobject, then the
> > class's destructor will be called to cleanup.
>
> That's... clever, and crazy, and unlike anything in kernel land...
Yep, I know. It made sense to me, rather than having two copies of the
destructor code, one of them filled with gotos :)
>
> Please put a comment near ctor field in nouveau_ofuncs to make this
> information easier to discover, without need to review the whole call chain...
Alright, I'll do something to that effect. I have been adding comments
as I go to some WIP stuff I have going on too.
Ben.
>
> Marcin
prev parent reply other threads:[~2012-10-09 0:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-07 22:49 [PATCH] drm/nouveau: fix error handling in core/core object creation functions Marcin Slusarz
[not found] ` <1349650171-25045-5-git-send-email-marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-10-07 23:01 ` Marcin Slusarz
2012-10-08 1:05 ` Ben Skeggs
[not found] ` <20121008010533.GA4197-6RkuLLNOGXsZ315U/fw+0NvLeJWuRmrY@public.gmane.org>
2012-10-08 22:50 ` Marcin Slusarz
[not found] ` <20121008225059.GD3103-OI9uyE9O0yo@public.gmane.org>
2012-10-09 0:05 ` Ben Skeggs [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=20121009000515.GA19660@turiel \
--to=skeggsb-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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.