Messages in this thread Patch in this message | | | From | Namhyung Kim <> | Subject | [PATCH 4/4] cfq-iosched: free cic_index if cfqd allocation fails | Date | Tue, 24 May 2011 12:18:51 +0900 |
| |
When struct cfq_data allocation fails, cic_index need to be freed.
Signed-off-by: Namhyung Kim <namhyung@gmail.com> --- block/cfq-iosched.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 4ceebd346710..7fe732a274b2 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -3881,8 +3881,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 -- 1.7.5.2
| |