From MAILER-DAEMON Tue Sep 23 08:37:46 2003 Date: 23 Sep 2003 08:37:46 +0000 From: Mail System Internal Data Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA X-IMAP: 1064306266 0000000000 Status: RO This text is part of the internal format of your mail folder, and is not a real message. It is created automatically by the mail system software. If deleted, important folder data will be lost, and it will be re-created with the data reset to initial values. From cieciwa@alpha.zarz.agh.edu.pl Tue Sep 23 00:49:30 2003 +0000 Status: R X-Status: X-Keywords: Return-Path: X-Original-To: cieciwa@alpha.zarz.agh.edu.pl Delivered-To: cieciwa@alpha.zarz.agh.edu.pl Received: from galaxy.uci.agh.edu.pl (galaxy.uci.agh.edu.pl [149.156.96.9]) by alpha.zarz.agh.edu.pl (Postfix) with ESMTP id 0CB8E241A5 for ; Tue, 23 Sep 2003 00:49:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [67.72.78.212]) by galaxy.uci.agh.edu.pl (Postfix) with ESMTP id 06210AF49E for ; Tue, 23 Sep 2003 01:01:55 +0200 (CEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261863AbTIVW6J (ORCPT ); Mon, 22 Sep 2003 18:58:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261164AbTIVW4Z (ORCPT ); Mon, 22 Sep 2003 18:56:25 -0400 Received: from fw.osdl.org ([65.172.181.6]:13794 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S261768AbTIVW4G (ORCPT ); Mon, 22 Sep 2003 18:56:06 -0400 Received: (from chrisw@localhost) by mail.osdl.org (8.11.6/8.11.6) id h8MMtfd13257; Mon, 22 Sep 2003 15:55:41 -0700 Date: Mon, 22 Sep 2003 15:55:41 -0700 From: Chris Wright To: David Yu Chen Cc: linux-kernel@vger.kernel.org, mc@cs.stanford.edu, torvalds@osdl.org, akpm@osdl.org Subject: Re: [CHECKER] 32 Memory Leaks on Error Paths Message-ID: <20030922155541.G18606@osdlab.pdx.osdl.net> References: <200309160435.h8G4ZkQM009953@elaine4.Stanford.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200309160435.h8G4ZkQM009953@elaine4.Stanford.EDU>; from dychen@stanford.edu on Mon, Sep 15, 2003 at 09:35:46PM -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org * David Yu Chen (dychen@stanford.edu) wrote: > [FILE: 2.6.0-test5/drivers/telephony/ixj_pcmcia.c] > [FUNC: ixj_attach] > [LINES: 53-64] > [VAR: link] > 48: client_reg_t client_reg; > 49: dev_link_t *link; > 50: int ret; > 51: DEBUG(0, "ixj_attach()\n"); > 52: /* Create new ixj device */ > START --> > 53: link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL); > 54: if (!link) > 55: return NULL; > 56: memset(link, 0, sizeof(struct dev_link_t)); > 57: link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; > 58: link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; > 59: link->io.IOAddrLines = 3; > 60: link->conf.Vcc = 50; > 61: link->conf.IntType = INT_MEMORY_AND_IO; > 62: link->priv = kmalloc(sizeof(struct ixj_info_t), GFP_KERNEL); > 63: if (!link->priv) > END --> > 64: return NULL; Yes, this is a bug. Patch below. thanks, -chris ===== drivers/telephony/ixj_pcmcia.c 1.6 vs edited ===== --- 1.6/drivers/telephony/ixj_pcmcia.c Sat Aug 16 13:22:52 2003 +++ edited/drivers/telephony/ixj_pcmcia.c Mon Sep 22 15:38:40 2003 @@ -60,8 +60,10 @@ link->conf.Vcc = 50; link->conf.IntType = INT_MEMORY_AND_IO; link->priv = kmalloc(sizeof(struct ixj_info_t), GFP_KERNEL); - if (!link->priv) + if (!link->priv) { + kfree(link); return NULL; + } memset(link->priv, 0, sizeof(struct ixj_info_t)); /* Register with Card Services */ link->next = dev_list; - 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/