s390/scm_blk: fix error return code in scm_blk_init()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 20 Mar 2013 12:40:54 +0000 (13:40 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 21 Mar 2013 12:35:38 +0000 (13:35 +0100)
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/scm_blk.c

index 713f0185f96dc85c6c04d5ce5141ace0a3cc96ce..e9b9c83928325fc708b72df751d51c08bf7bde82 100644 (file)
@@ -463,12 +463,15 @@ static int __init scm_blk_init(void)
                goto out;
 
        scm_major = ret;
-       if (scm_alloc_rqs(nr_requests))
+       ret = scm_alloc_rqs(nr_requests);
+       if (ret)
                goto out_unreg;
 
        scm_debug = debug_register("scm_log", 16, 1, 16);
-       if (!scm_debug)
+       if (!scm_debug) {
+               ret = -ENOMEM;
                goto out_free;
+       }
 
        debug_register_view(scm_debug, &debug_hex_ascii_view);
        debug_set_level(scm_debug, 2);