提交 fff60fab 编写于 作者: S Sebastian Ott 提交者: Martin Schwidefsky

s390/scm_blk: fix memleak in init function

If the allocation of a single request fails the already allocated
requests will not be freed.
Reviewed-by: NPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: NSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 bd86055f
...@@ -465,7 +465,7 @@ static int __init scm_blk_init(void) ...@@ -465,7 +465,7 @@ static int __init scm_blk_init(void)
scm_major = ret; scm_major = ret;
ret = scm_alloc_rqs(nr_requests); ret = scm_alloc_rqs(nr_requests);
if (ret) if (ret)
goto out_unreg; goto out_free;
scm_debug = debug_register("scm_log", 16, 1, 16); scm_debug = debug_register("scm_log", 16, 1, 16);
if (!scm_debug) { if (!scm_debug) {
...@@ -486,7 +486,6 @@ static int __init scm_blk_init(void) ...@@ -486,7 +486,6 @@ static int __init scm_blk_init(void)
debug_unregister(scm_debug); debug_unregister(scm_debug);
out_free: out_free:
scm_free_rqs(); scm_free_rqs();
out_unreg:
unregister_blkdev(scm_major, "scm"); unregister_blkdev(scm_major, "scm");
out: out:
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册