diff options
author | Namhyung Kim <namhyung@gmail.com> | 2011-05-24 04:23:22 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-05-24 04:23:22 -0400 |
commit | 1547010e6e15a3f44f49381246421a1e19de526e (patch) | |
tree | 560796824e489a5d5c0b6de7a143d9a48a558d83 /block | |
parent | 20359f27e8ff115f7cddf3da5b3a6cdcca2e650d (diff) |
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 <namhyung@gmail.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block')
-rw-r--r-- | 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 6dd2179cf1a4..7c52d6888924 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -3973,8 +3973,12 @@ static void *cfq_init_queue(struct request_queue *q) | |||
3973 | return NULL; | 3973 | return NULL; |
3974 | 3974 | ||
3975 | cfqd = kmalloc_node(sizeof(*cfqd), GFP_KERNEL | __GFP_ZERO, q->node); | 3975 | cfqd = kmalloc_node(sizeof(*cfqd), GFP_KERNEL | __GFP_ZERO, q->node); |
3976 | if (!cfqd) | 3976 | if (!cfqd) { |
3977 | spin_lock(&cic_index_lock); | ||
3978 | ida_remove(&cic_index_ida, i); | ||
3979 | spin_unlock(&cic_index_lock); | ||
3977 | return NULL; | 3980 | return NULL; |
3981 | } | ||
3978 | 3982 | ||
3979 | /* | 3983 | /* |
3980 | * Don't need take queue_lock in the routine, since we are | 3984 | * Don't need take queue_lock in the routine, since we are |