mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 15:15:47 +00:00
[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: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
ac07860264
commit
5693ce6f9b
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue