mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
cfq-iosched: free cic_index if cfqd allocation fails
When struct cfq_data allocation fails, cic_index need to be freed. Signed-off-by: Namhyung Kim <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
20359f27e8
commit
1547010e6e
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue