Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760965AbXHGLQL (ORCPT ); Tue, 7 Aug 2007 07:16:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760075AbXHGLPM (ORCPT ); Tue, 7 Aug 2007 07:15:12 -0400 Received: from mtagate6.de.ibm.com ([195.212.29.155]:2212 "EHLO mtagate6.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759106AbXHGLPI (ORCPT ); Tue, 7 Aug 2007 07:15:08 -0400 Message-Id: <20070807111844.909113621@de.ibm.com> References: <20070807111519.972871123@de.ibm.com> User-Agent: quilt/0.46-1 Date: Tue, 07 Aug 2007 13:15:21 +0200 From: Martin Schwidefsky To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Cc: Cornelia Huck , Martin Schwidefsky Subject: [patch 01/18] cio: avoid memory leak on error in css_alloc_subchannel(). Content-Disposition: inline; filename=001-cio-leak.diff Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1058 Lines: 36 From: Cornelia Huck 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 --- drivers/s390/cio/css.c | 1 + 1 file changed, 1 insertion(+) Index: quilt-2.6/drivers/s390/cio/css.c =================================================================== --- quilt-2.6.orig/drivers/s390/cio/css.c +++ quilt-2.6/drivers/s390/cio/css.c @@ -79,6 +79,7 @@ css_alloc_subchannel(struct subchannel_i sch->schib.pmcw.intparm = (__u32)(unsigned long)sch; ret = cio_modify(sch); if (ret) { + kfree(sch->lock); kfree(sch); return ERR_PTR(ret); } -- blue skies, Martin. "Reality continues to ruin my life." - Calvin. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/