]> err.no Git - linux-2.6/commitdiff
[S390] cio: avoid memory leak on error in css_alloc_subchannel().
authorCornelia Huck <cornelia.huck@de.ibm.com>
Fri, 10 Aug 2007 12:32:26 +0000 (14:32 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 10 Aug 2007 12:32:36 +0000 (14:32 +0200)
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>
drivers/s390/cio/css.c

index 1c27a5a06b4982d6f754484f52ad4187b8f9162d..5635e656c1a369b92bd0027c0e8beca261baed3c 100644 (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);
        }