[PATCH][2.6.0-test6] fix drivers/char/misc.c module autoloading breakage

From: Mikael Pettersson
Date: Sat Oct 04 2003 - 08:59:05 EST


drivers/char/misc.c was changed in 2.6.0-test6 to use the
common list macros instead of its own list code. The first
open does load the module and increment its use count, but
a bug in test6 causes a failure to be reported anyway. This
(1) signals an error to user-space where there is none, and
(2) makes the module non-unloadable.

Fixed by the patch below. Tested. Please apply.

/Mikael

diff -ruN linux-2.6.0-test6/drivers/char/misc.c linux-2.6.0-test6.char-misc-fix/drivers/char/misc.c
--- linux-2.6.0-test6/drivers/char/misc.c 2003-09-28 12:19:40.000000000 +0200
+++ linux-2.6.0-test6.char-misc-fix/drivers/char/misc.c 2003-10-04 14:55:45.000000000 +0200
@@ -157,12 +157,11 @@
list_for_each_entry(c, &misc_list, list) {
if (c->minor == minor) {
new_fops = fops_get(c->fops);
- if (!new_fops)
- goto fail;
break;
}
}
- goto fail;
+ if (!new_fops)
+ goto fail;
}

err = 0;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/