summaryrefslogtreecommitdiffstats
path: root/block/genhd.c
diff options
context:
space:
mode:
authorCheng Renquan <crquan@gmail.com>2008-11-20 08:37:37 +0100
committerJens Axboe <jens.axboe@oracle.com>2008-12-03 12:41:20 +0100
commitbf91db18ac2852a3ff39fe25ff56c5557c0fff78 (patch)
tree42ce67fceb2b3072717cde31c8b4474f4c4a050d /block/genhd.c
parent53cc0b2948bcb8a084982e6c1f9bd7b337e0df38 (diff)
downloadlinux-stable-bf91db18ac2852a3ff39fe25ff56c5557c0fff78.tar.gz
linux-stable-bf91db18ac2852a3ff39fe25ff56c5557c0fff78.tar.bz2
linux-stable-bf91db18ac2852a3ff39fe25ff56c5557c0fff78.zip
block: set disk->node_id before it's being used
disk->node_id will be refered in allocating in disk_expand_part_tbl, so we should set it before disk->node_id is refered. Signed-off-by: Cheng Renquan <crquan@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 27549e470da5..2f7feda61e35 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1102,6 +1102,7 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
kfree(disk);
return NULL;
}
+ disk->node_id = node_id;
if (disk_expand_part_tbl(disk, 0)) {
free_part_stats(&disk->part0);
kfree(disk);
@@ -1116,7 +1117,6 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
device_initialize(disk_to_dev(disk));
INIT_WORK(&disk->async_notify,
media_change_notify_thread);
- disk->node_id = node_id;
}
return disk;
}