Skip to content

Commit

Permalink
block: fix return value on cfq_init() failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
htejun authored and axboe committed Jun 4, 2012
1 parent 87c9ea7 commit fd79495
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4202,6 +4202,7 @@ static int __init cfq_init(void)
if (ret)
return ret;

ret = -ENOMEM;
cfq_pool = KMEM_CACHE(cfq_queue, 0);
if (!cfq_pool)
goto err_pol_unreg;
Expand Down

0 comments on commit fd79495

Please sign in to comment.