mtd/drivers/mtd mtd_blkdevs-24.c,1.9,1.10

David Woodhouse dwmw2 at infradead.org
Mon May 26 07:16:47 EDT 2003


Update of /home/cvs/mtd/drivers/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv21870

Modified Files:
	mtd_blkdevs-24.c 
Log Message:
Fix __MOD_DEC_USE_COUNT(NULL) oops.
Revert to proper 2.4 signal locking stuff, not O(1) scheduler version.


Index: mtd_blkdevs-24.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/mtd_blkdevs-24.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- mtd_blkdevs-24.c	21 May 2003 15:15:03 -0000	1.9
+++ mtd_blkdevs-24.c	26 May 2003 11:16:44 -0000	1.10
@@ -122,7 +122,7 @@
 	   actually want to deal with signals. We can't just call 
 	   exit_sighand() since that'll cause an oops when we finally
 	   do exit. */
-#if 0
+#if 1
 	spin_lock_irq(&current->sigmask_lock);
 	sigfillset(&current->blocked);
 	recalc_sigpending(current);
@@ -241,9 +241,11 @@
 	ret = 0;
 	if (tr->open && (ret = tr->open(dev, i, f))) {
 		dev->mtd->usecount--;
-		__MOD_DEC_USE_COUNT(dev->mtd->owner);
+		if (dev->mtd->owner)
+			__MOD_DEC_USE_COUNT(dev->mtd->owner);
 	out_tr:
-		__MOD_DEC_USE_COUNT(tr->owner);
+		if (tr->owner)
+			__MOD_DEC_USE_COUNT(tr->owner);
 	}
  out:
 	up(&mtd_table_mutex);
@@ -279,8 +281,10 @@
 
 	if (!ret) {
 		dev->mtd->usecount--;
-		__MOD_DEC_USE_COUNT(dev->mtd->owner);
-		__MOD_DEC_USE_COUNT(tr->owner);
+		if (dev->mtd->owner)
+			__MOD_DEC_USE_COUNT(dev->mtd->owner);
+		if (tr->owner)
+			__MOD_DEC_USE_COUNT(tr->owner);
 	}
 	
 	up(&mtd_table_mutex);




More information about the linux-mtd-cvs mailing list