Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -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);
	}
	}