Commit 5693ce6f authored by Cornelia Huck's avatar Cornelia Huck Committed by Martin Schwidefsky

[S390] cio: avoid memory leak on error in css_alloc_subchannel().

sch->lock has been allocated in cio_validate_subchannel(), it must be
freed if cio_modify() fails.
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent ac078602
...@@ -79,6 +79,7 @@ css_alloc_subchannel(struct subchannel_id schid) ...@@ -79,6 +79,7 @@ css_alloc_subchannel(struct subchannel_id schid)
sch->schib.pmcw.intparm = (__u32)(unsigned long)sch; sch->schib.pmcw.intparm = (__u32)(unsigned long)sch;
ret = cio_modify(sch); ret = cio_modify(sch);
if (ret) { if (ret) {
kfree(sch->lock);
kfree(sch); kfree(sch);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment