Skip to content

Commit

Permalink
[S390] cio: avoid memory leak on error in css_alloc_subchannel().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Cornelia Huck authored and Martin Schwidefsky committed Aug 10, 2007
1 parent ac07860 commit 5693ce6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/s390/cio/css.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 5693ce6

Please sign in to comment.