Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1547010e authored by Namhyung Kim's avatar Namhyung Kim Committed by Jens Axboe
Browse files

cfq-iosched: free cic_index if cfqd allocation fails



When struct cfq_data allocation fails, cic_index need to be freed.

Signed-off-by: default avatarNamhyung Kim <namhyung@gmail.com>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent 20359f27
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -3973,8 +3973,12 @@ static void *cfq_init_queue(struct request_queue *q)
		return NULL;

	cfqd = kmalloc_node(sizeof(*cfqd), GFP_KERNEL | __GFP_ZERO, q->node);
	if (!cfqd)
	if (!cfqd) {
		spin_lock(&cic_index_lock);
		ida_remove(&cic_index_ida, i);
		spin_unlock(&cic_index_lock);
		return NULL;
	}

	/*
	 * Don't need take queue_lock in the routine, since we are