projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
20359f2
)
cfq-iosched: free cic_index if cfqd allocation fails
author
Namhyung Kim
<namhyung@gmail.com>
Tue, 24 May 2011 08:23:22 +0000
(10:23 +0200)
committer
Jens Axboe
<jaxboe@fusionio.com>
Tue, 24 May 2011 08:23:22 +0000
(10:23 +0200)
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>
block/cfq-iosched.c
patch
|
blob
|
blame
|
history
diff --git
a/block/cfq-iosched.c
b/block/cfq-iosched.c
index 6dd2179cf1a4a42c2473cdae3ca1ba023e78ea6b..7c52d6888924c53215579b1b663083be376dfa48 100644
(file)
--- a/
block/cfq-iosched.c
+++ b/
block/cfq-iosched.c
@@
-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