Skip to content

Commit

Permalink
s390/scm_blk: fix memleak in init function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Apr 26, 2013
1 parent bd86055 commit fff60fa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/s390/block/scm_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -486,7 +486,6 @@ static int __init scm_blk_init(void)
debug_unregister(scm_debug);
out_free:
scm_free_rqs();
out_unreg:
unregister_blkdev(scm_major, "scm");
out:
return ret;
Expand Down

0 comments on commit fff60fa

Please sign in to comment.