Skip to contentSkip to conversation

video: igafb: introduce lost 'return'

PATCH In review Kulikov Vasiliy 2 participants 2 messages Jul 31, 2010 – Aug 2, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: igafb: introduce lost 'return'

If iga_init() fails, code releases resources and continues to use it. It seems that after releasing resources 'return' should be.

---
 drivers/video/igafb.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/video/igafb.c +1 -0
index 15d2001..c4e6fc0 100644
@@ -531,6 +531,7 @@ int __init igafb_init(void)
 		iounmap(info->screen_base);
 		kfree(par->mmap_map);
 		kfree(info);
+		return -ENODEV;
         }
 
 #ifdef CONFIG_SPARC
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 13 lines · On Sat, 31 Jul 2010 20:34:30 +0400 Kulikov Vasiliy <[email protected]> wrote:

If iga_init() fails, code releases resources and continues to use it. It seems that after releasing resources 'return' should be.

---
 drivers/video/igafb.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/video/igafb.c +0 -0
index 15d2001..c4e6fc0 100644

drivers/video/igafb.c int __init igafb_init(void) · line 537

Quoted 7 lines
drivers/video/igafb.c +1 -0
@@ -531,6 +531,7 @@ int __init igafb_init(void)
 		iounmap(info->screen_base);
 		kfree(par->mmap_map);
 		kfree(info);
+		return -ENODEV;
         }
 
 #ifdef CONFIG_SPARC

Fair enough.

We may as well do this, too:

drivers/video/igafb.c renamed from drivers/video/igafb.c~drivers-video-igafbc-make-igafb_setup-and-igafb_init-static +2 -2
@@ -368,7 +368,7 @@ static int __init iga_init(struct fb_inf
 	return 1;
 }
 
-int __init igafb_init(void)
+static int __init igafb_init(void)
 {
         struct fb_info *info;
         struct pci_dev *pdev;
@@ -557,7 +557,7 @@ int __init igafb_init(void)
 	return 0;
 }
 
-int __init igafb_setup(char *options)
+static int __init igafb_setup(char *options)
 {
     char *this_opt;
 

_