From: Cornelia Huck Date: Fri, 10 Aug 2007 12:32:26 +0000 (+0200) Subject: [S390] cio: avoid memory leak on error in css_alloc_subchannel(). X-Git-Tag: v2.6.23-rc3~8^2~9 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5693ce6f9b9f08942e55e3825db014f8b1205772;p=linux-2.6 [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 Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 1c27a5a06b..5635e656c1 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -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); }