linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][2.6.0-test6] fix drivers/char/misc.c module autoloading breakage
@ 2003-10-04 13:58 Mikael Pettersson
  0 siblings, 0 replies; only message in thread
From: Mikael Pettersson @ 2003-10-04 13:58 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, shemminger

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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-04 13:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-04 13:58 [PATCH][2.6.0-test6] fix drivers/char/misc.c module autoloading breakage Mikael Pettersson

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