[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:
Cornelia Huck 2007-08-10 14:32:26 +02:00 committed by Martin Schwidefsky
parent ac07860264
commit 5693ce6f9b

View file

@ -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);
}