From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Slusarz Subject: Re: [PATCH] drm/nouveau: fix error handling in core/core object creation functions Date: Tue, 9 Oct 2012 00:50:59 +0200 Message-ID: <20121008225059.GD3103@joi.lan> References: <1349650171-25045-5-git-send-email-marcin.slusarz@gmail.com> <20121008010533.GA4197@turiel.bne.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20121008010533.GA4197-6RkuLLNOGXsZ315U/fw+0NvLeJWuRmrY@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nouveau-bounces+gcfxn-nouveau=m.gmane.org-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Errors-To: nouveau-bounces+gcfxn-nouveau=m.gmane.org-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org To: Ben Skeggs Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: nouveau.vger.kernel.org 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 > > --- > > 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... 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... Marcin