Commit d03500e8 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fix MOD_INC_USE_COUNT usage in mtd

From: Christoph Hellwig <hch@lst.de>

mtd driver need to get another reference if ->probe succeeds (strange design
if you ask me, but what the heck..), and while most drivers have been switched
to __module_get already two are still missing.
parent 655d8183
...@@ -780,8 +780,8 @@ static struct mtd_info *amd_flash_probe(struct map_info *map) ...@@ -780,8 +780,8 @@ static struct mtd_info *amd_flash_probe(struct map_info *map)
map->fldrv_priv = private; map->fldrv_priv = private;
map->fldrv = &amd_flash_chipdrv; map->fldrv = &amd_flash_chipdrv;
MOD_INC_USE_COUNT;
__module_get(THIS_MODULE);
return mtd; return mtd;
} }
......
...@@ -154,7 +154,7 @@ struct mtd_info *sharp_probe(struct map_info *map) ...@@ -154,7 +154,7 @@ struct mtd_info *sharp_probe(struct map_info *map)
map->fldrv = &sharp_chipdrv; map->fldrv = &sharp_chipdrv;
map->fldrv_priv = sharp; map->fldrv_priv = sharp;
MOD_INC_USE_COUNT; __module_get(THIS_MODULE);
return mtd; return mtd;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment