diff options
author | Tejun Heo <tj@kernel.org> | 2012-06-04 04:01:38 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-06-04 04:01:38 -0400 |
commit | fd7949564ced88385ca7758a4c1f47c274233dd5 (patch) | |
tree | b2f5ec960e17c604148f17239824c366954d8135 /block/cfq-iosched.c | |
parent | 87c9ea76a242c2f9063e2a8f3e90846c932c61a7 (diff) |
block: fix return value on cfq_init() failure
cfq_init() would return zero after kmem cache creation failure. Fix
so that it returns -ENOMEM.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 673c977cc2bf..ae5113d3ebae 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -4202,6 +4202,7 @@ static int __init cfq_init(void) | |||
4202 | if (ret) | 4202 | if (ret) |
4203 | return ret; | 4203 | return ret; |
4204 | 4204 | ||
4205 | ret = -ENOMEM; | ||
4205 | cfq_pool = KMEM_CACHE(cfq_queue, 0); | 4206 | cfq_pool = KMEM_CACHE(cfq_queue, 0); |
4206 | if (!cfq_pool) | 4207 | if (!cfq_pool) |
4207 | goto err_pol_unreg; | 4208 | goto err_pol_unreg; |