linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Free when fb can't be registered in video/aty/atyfb_base.c
@ 2007-10-27  1:55 Roel Kluin
  2007-10-27  3:25 ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Roel Kluin @ 2007-10-27  1:55 UTC (permalink / raw)
  To: linux-fbdev-devel

I am a bit uncertain about this one, but I think a 'free' is required here?
--
Free buffer when the framebuffer can't be registered

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index d775eb6..7ccc78e 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2680,10 +2680,13 @@ static int __devinit aty_init(struct fb_info *info)
 #endif /* CONFIG_FB_ATY_CT */
 	info->var = var;
 
-	fb_alloc_cmap(&info->cmap, 256, 0);
+	if (fb_alloc_cmap(&info->cmap, 256, 0) < 0)
+		goto aty_init_exit;
 
-	if (register_framebuffer(info) < 0)
+	if (register_framebuffer(info) < 0) {
+                fb_dealloc_cmap(&info->cmap);
 		goto aty_init_exit;
+	}
 
 	fb_list = info;
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Free when fb can't be registered in video/aty/atyfb_base.c
  2007-10-27  1:55 [PATCH] Free when fb can't be registered in video/aty/atyfb_base.c Roel Kluin
@ 2007-10-27  3:25 ` Randy Dunlap
  2007-10-27 12:31   ` Roel Kluin
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2007-10-27  3:25 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: adaplas

On Sat, 27 Oct 2007 03:55:54 +0200 Roel Kluin wrote:

> I am a bit uncertain about this one, but I think a 'free' is required here?
> --
> Free buffer when the framebuffer can't be registered
> 
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
> ---
> diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
> index d775eb6..7ccc78e 100644
> --- a/drivers/video/aty/atyfb_base.c
> +++ b/drivers/video/aty/atyfb_base.c
> @@ -2680,10 +2680,13 @@ static int __devinit aty_init(struct fb_info *info)
>  #endif /* CONFIG_FB_ATY_CT */
>  	info->var = var;
>  
> -	fb_alloc_cmap(&info->cmap, 256, 0);
> +	if (fb_alloc_cmap(&info->cmap, 256, 0) < 0)
> +		goto aty_init_exit;
>  
> -	if (register_framebuffer(info) < 0)
> +	if (register_framebuffer(info) < 0) {
> +                fb_dealloc_cmap(&info->cmap);

Use tabs for indent above, not spaces.

Yes, looks needed to me.  Hopefully Tony will correct us if we
are wrong.

Also appears to be needed in:
68328fb.c, ambaclcd.c, asiliantfb.c, atafb.c, ...
(I stopped looking for now.)


>  		goto aty_init_exit;
> +	}
>  
>  	fb_list = info;
>  



---
~Randy

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Free when fb can't be registered in video/aty/atyfb_base.c
  2007-10-27  3:25 ` Randy Dunlap
@ 2007-10-27 12:31   ` Roel Kluin
  0 siblings, 0 replies; 3+ messages in thread
From: Roel Kluin @ 2007-10-27 12:31 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-fbdev-devel, adaplas

Randy Dunlap wrote:
> 
> Use tabs for indent above, not spaces.
> 
> Yes, looks needed to me.  Hopefully Tony will correct us if we
> are wrong.
> 

Thanks for reviewing, here is one without the little spaces
--
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
--
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index d775eb6..669abd3 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2680,10 +2680,13 @@ static int __devinit aty_init(struct fb_info *info)
 #endif /* CONFIG_FB_ATY_CT */
 	info->var = var;
 
-	fb_alloc_cmap(&info->cmap, 256, 0);
+	if (fb_alloc_cmap(&info->cmap, 256, 0) < 0)
+		goto aty_init_exit;
 
-	if (register_framebuffer(info) < 0)
+	if (register_framebuffer(info) < 0) {
+		fb_dealloc_cmap(&info->cmap);
 		goto aty_init_exit;
+	}
 
 	fb_list = info;
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-27 12:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-27  1:55 [PATCH] Free when fb can't be registered in video/aty/atyfb_base.c Roel Kluin
2007-10-27  3:25 ` Randy Dunlap
2007-10-27 12:31   ` Roel Kluin

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).