Skip to content

Commit

Permalink
block: set disk->node_id before it's being used
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
crquan authored and Jens Axboe committed Dec 3, 2008
1 parent 53cc0b2 commit bf91db1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down

0 comments on commit bf91db1

Please sign in to comment.