[PATCH] Trivial fix for Oops on unmount.

Pantelis Antoniou
2003-06-12T14:22:38Z

[-- Attachment #1: Type: text/plain, Size: 134 bytes --]

Hi

This is a trivial patch which fixes some oopses for me in 2.4.21-rc7 with
MTD compiled in instead of modules.

Regards

Pantelis

[-- Attachment #2: oops.patch --]
[-- Type: text/plain, Size: 554 bytes --]

--- drivers/mtd/mtd_blkdevs-24.c Thu Jun 12 15:44:47 2003
+++ drivers-nand/mtd/mtd_blkdevs-24.c Thu Jun 12 17:21:15 2003
@@ -239,8 +239,10 @@
tr->usecount--;
dev->usecount--;
dev->mtd->usecount--;
+ if (dev->mtd->owner)
__MOD_DEC_USE_COUNT(dev->mtd->owner);
out_tr:
+ if (tr->owner)
__MOD_DEC_USE_COUNT(tr->owner);
}
out:
@@ -279,7 +281,9 @@
tr->usecount--;
dev->usecount--;
dev->mtd->usecount--;
+ if (dev->mtd->owner)
__MOD_DEC_USE_COUNT(dev->mtd->owner);
+ if (tr->owner)
__MOD_DEC_USE_COUNT(tr->owner);
}