diff options
-rw-r--r-- | block/blk-core.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 853f92749202..4cd5ffc18442 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -693,20 +693,11 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id) | |||
693 | if (!uninit_q) | 693 | if (!uninit_q) |
694 | return NULL; | 694 | return NULL; |
695 | 695 | ||
696 | uninit_q->flush_rq = kzalloc(sizeof(struct request), GFP_KERNEL); | ||
697 | if (!uninit_q->flush_rq) | ||
698 | goto out_cleanup_queue; | ||
699 | |||
700 | q = blk_init_allocated_queue(uninit_q, rfn, lock); | 696 | q = blk_init_allocated_queue(uninit_q, rfn, lock); |
701 | if (!q) | 697 | if (!q) |
702 | goto out_free_flush_rq; | 698 | blk_cleanup_queue(uninit_q); |
703 | return q; | ||
704 | 699 | ||
705 | out_free_flush_rq: | 700 | return q; |
706 | kfree(uninit_q->flush_rq); | ||
707 | out_cleanup_queue: | ||
708 | blk_cleanup_queue(uninit_q); | ||
709 | return NULL; | ||
710 | } | 701 | } |
711 | EXPORT_SYMBOL(blk_init_queue_node); | 702 | EXPORT_SYMBOL(blk_init_queue_node); |
712 | 703 | ||
@@ -717,6 +708,10 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn, | |||
717 | if (!q) | 708 | if (!q) |
718 | return NULL; | 709 | return NULL; |
719 | 710 | ||
711 | q->flush_rq = kzalloc(sizeof(struct request), GFP_KERNEL); | ||
712 | if (!q->flush_rq) | ||
713 | return NULL; | ||
714 | |||
720 | if (blk_init_rl(&q->root_rl, q, GFP_KERNEL)) | 715 | if (blk_init_rl(&q->root_rl, q, GFP_KERNEL)) |
721 | return NULL; | 716 | return NULL; |
722 | 717 | ||