[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;
|
||||
ret = cio_modify(sch);
|
||||
if (ret) {
|
||||
kfree(sch->lock);
|
||||
kfree(sch);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue