Skip to contentSkip to conversation

ad1848 infinite loop fix

PATCH In review Gerald Teschl 2 participants 3 messages Aug 24, 2002 – Aug 25, 2002 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ad1848 infinite loop fix

I think I found the problem which causes the infinite loop when the activation fails:

drivers/sound/ad1848.c Sat Aug 24 23:20:58 2002 renamed from drivers/sound/ad1848.c.orig Sat Aug 24 23:19:54 2002 +0 -0
@@ -3058,7 +3058,7 @@
        else
                printk(KERN_INFO "ad1848: Failed to initialize %s\n", 

devname);

- return 0;
+ return -ENODEV;
}

static int __init ad1848_isapnp_probe(struct address_info *hw_config)

#1 lore raw
Quoted 12 lines
drivers/sound/ad1848.c Sat Aug 24 23:20:58 2002 renamed from drivers/sound/ad1848.c.orig Sat Aug 24 23:19:54 2002 +1 -1
@@ -3058,7 +3058,7 @@
        else
                printk(KERN_INFO "ad1848: Failed to initialize %s\n", 
 devname);
 
-       return 0;
+       return -ENODEV;
 }
 
Quoted 1 line

static int __init ad1848_isapnp_probe(struct address_info *hw_config)

This will break the isapnp probe in ad1848, the problem could possibly be elsewhere. You have to be a bit careful when changing the return values of functions in some of the older OSS code.

Zwane

Signature · 1 line
function.linuxpower.ca
#2 lore raw
In reply to Gerald Teschl
Quoted 12 lines · Zwane Mwaikambo
Quoted 12 lines
drivers/sound/ad1848.c Sat Aug 24 23:20:58 2002 renamed from drivers/sound/ad1848.c.orig Sat Aug 24 23:19:54 2002 +1 -1
@@ -3058,7 +3058,7 @@
        else
                printk(KERN_INFO "ad1848: Failed to initialize %s\n", 
 devname);
 
-       return 0;
+       return -ENODEV;
 }
 
Quoted 6 lines
Quoted 1 line

static int __init ad1848_isapnp_probe(struct address_info *hw_config)

This will break the isapnp probe in ad1848, the problem could possibly be elsewhere. You have to be a bit careful when changing the return values of functions in some of the older OSS code.

I just looked into some of the other drivers and they also use "return 0" in case of failure. So you are right, this is not the proper way to fix this! But this means that there are some generic problems with the loading of kernel modules!?

If I use "return -ENODEV" the module will do the init stuff, fail, and thats it. With the original "return 0" the module will do the init stuff in an infinite loop. I do not think this is a problem inside the module since it looks like the main init function gets called over and over again (blocking the kernel and hence freezing the system).

Gerald