summaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2013-04-25 13:03:18 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-04-26 09:07:17 +0200
commitfff60fabc71c41bd1bd4beb4fdd735bb8e01096c (patch)
tree7ce1be7df2d0c10adf9be0ba921673a13d8125a6 /drivers/s390
parentbd86055fc938493259a15dc00ee77435b4d2e83f (diff)
downloadlinux-fff60fabc71c41bd1bd4beb4fdd735bb8e01096c.tar.bz2
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: Peter Oberparleiter <oberpar@linux.vnet.ibm.com> Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/scm_blk.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c
index e9b9c8392832..b303cab76a7f 100644
--- a/drivers/s390/block/scm_blk.c
+++ b/drivers/s390/block/scm_blk.c
@@ -465,7 +465,7 @@ static int __init scm_blk_init(void)
scm_major = ret;
ret = scm_alloc_rqs(nr_requests);
if (ret)
- goto out_unreg;
+ goto out_free;
scm_debug = debug_register("scm_log", 16, 1, 16);
if (!scm_debug) {
@@ -486,7 +486,6 @@ out_dbf:
debug_unregister(scm_debug);
out_free:
scm_free_rqs();
-out_unreg:
unregister_blkdev(scm_major, "scm");
out:
return ret;