diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2007-08-10 08:32:26 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-08-10 08:32:36 -0400 |
commit | 5693ce6f9b9f08942e55e3825db014f8b1205772 (patch) | |
tree | 6aa4dbe6eb1720f1427af96eb33a98de4c721cf1 | |
parent | ac07860264bd2b18834d3fa3be47032115524cea (diff) |
[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>
-rw-r--r-- | drivers/s390/cio/css.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 1c27a5a06b49..5635e656c1a3 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -79,6 +79,7 @@ css_alloc_subchannel(struct subchannel_id schid) | |||
79 | sch->schib.pmcw.intparm = (__u32)(unsigned long)sch; | 79 | sch->schib.pmcw.intparm = (__u32)(unsigned long)sch; |
80 | ret = cio_modify(sch); | 80 | ret = cio_modify(sch); |
81 | if (ret) { | 81 | if (ret) { |
82 | kfree(sch->lock); | ||
82 | kfree(sch); | 83 | kfree(sch); |
83 | return ERR_PTR(ret); | 84 | return ERR_PTR(ret); |
84 | } | 85 | } |