summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-05-05 14:53:48 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-05 14:53:48 -0700
commit91ef5d2d6e934762db9c3e0d9e5b2862e40ea429 (patch)
treedb494325a630175efe6ca9c15d5ec26d935310e1
parent568cb09b9d889b6f2852ede19772b8e9eed36c1e (diff)
parent56cf6504fc1c0c221b82cebc16a444b684140fb7 (diff)
Merge master.kernel.org:/home/rmk/linux-2.6-mmc
* master.kernel.org:/home/rmk/linux-2.6-mmc: [BLOCK] Fix oops on removal of SD/MMC card
-rw-r--r--block/genhd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 5a8d3bf02f17..d96572589621 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -182,6 +182,7 @@ static int exact_lock(dev_t dev, void *data)
*/
void add_disk(struct gendisk *disk)
{
+ get_device(disk->driverfs_dev);
disk->flags |= GENHD_FL_UP;
blk_register_region(MKDEV(disk->major, disk->first_minor),
disk->minors, NULL, exact_match, exact_lock, disk);
@@ -427,6 +428,7 @@ static struct attribute * default_attrs[] = {
static void disk_release(struct kobject * kobj)
{
struct gendisk *disk = to_disk(kobj);
+ put_device(disk->driverfs_dev);
kfree(disk->random);
kfree(disk->part);
free_disk_stats(disk);