[PATCH 1/2] block: fix return value on cfq_init() failure

From: Tejun Heo
Date: Mon Jun 04 2012 - 00:30:42 EST


cfq_init() would return zero after kmem cache creation failure. Fix
so that it returns -ENOMEM.

Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
---
block/cfq-iosched.c | 1 +
1 file changed, 1 insertion(+)

--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/