]> git.pld-linux.org Git - packages/kernel.git/blame - 2.6.0-t5-memleak-scsi_debug-lkml.patch
+CONFIG_IP_NF_MATCH_LAYER7=m
[packages/kernel.git] / 2.6.0-t5-memleak-scsi_debug-lkml.patch
CommitLineData
d912b53b 1From MAILER-DAEMON Tue Sep 23 08:37:13 2003
2Date: 23 Sep 2003 08:37:13 +0000
3From: Mail System Internal Data <MAILER-DAEMON@alpha.zarz.agh.edu.pl>
4Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA
5X-IMAP: 1064306233 0000000000
6Status: RO
7
8This text is part of the internal format of your mail folder, and is not
9a real message. It is created automatically by the mail system software.
10If deleted, important folder data will be lost, and it will be re-created
11with the data reset to initial values.
12
13From cieciwa@alpha.zarz.agh.edu.pl Tue Sep 23 00:47:23 2003 +0000
14Status: R
15X-Status:
16X-Keywords:
17Return-Path: <linux-kernel-owner+cieciwa=40alpha.zarz.agh.edu.pl@vger.kernel.org>
18X-Original-To: cieciwa@alpha.zarz.agh.edu.pl
19Delivered-To: cieciwa@alpha.zarz.agh.edu.pl
20Received: from galaxy.uci.agh.edu.pl (galaxy.uci.agh.edu.pl [149.156.96.9])
21 by alpha.zarz.agh.edu.pl (Postfix) with ESMTP id D5104241A5
22 for <cieciwa@alpha.zarz.agh.edu.pl>; Tue, 23 Sep 2003 00:47:23 +0000 (UTC)
23Received: from vger.kernel.org (vger.kernel.org [67.72.78.212])
24 by galaxy.uci.agh.edu.pl (Postfix) with ESMTP id 1E9D0AF3D2
25 for <cieciwa@alpha.zarz.agh.edu.pl>; Tue, 23 Sep 2003 00:59:49 +0200 (CEST)
26Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
27 id S261746AbTIVW4C (ORCPT <rfc822;cieciwa@alpha.zarz.agh.edu.pl>);
28 Mon, 22 Sep 2003 18:56:02 -0400
29Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261808AbTIVW4B
30 (ORCPT <rfc822;linux-kernel-outgoing>);
31 Mon, 22 Sep 2003 18:56:01 -0400
32Received: from fw.osdl.org ([65.172.181.6]:9186 "EHLO mail.osdl.org")
33 by vger.kernel.org with ESMTP id S261746AbTIVWzV (ORCPT
34 <rfc822;linux-kernel@vger.kernel.org>);
35 Mon, 22 Sep 2003 18:55:21 -0400
36Received: (from chrisw@localhost)
37 by mail.osdl.org (8.11.6/8.11.6) id h8MMtDR13235;
38 Mon, 22 Sep 2003 15:55:13 -0700
39Date: Mon, 22 Sep 2003 15:55:13 -0700
40From: Chris Wright <chrisw@osdl.org>
41To: David Yu Chen <dychen@stanford.edu>
42Cc: linux-kernel@vger.kernel.org, mc@cs.stanford.edu,
43 James.Bottomley@SteelEye.com
44Subject: Re: [CHECKER] 32 Memory Leaks on Error Paths
45Message-ID: <20030922155513.F18606@osdlab.pdx.osdl.net>
46References: <200309160435.h8G4ZkQM009953@elaine4.Stanford.EDU>
47Mime-Version: 1.0
48Content-Type: text/plain; charset=us-ascii
49Content-Disposition: inline
50User-Agent: Mutt/1.2.5i
51In-Reply-To: <200309160435.h8G4ZkQM009953@elaine4.Stanford.EDU>; from dychen@stanford.edu on Mon, Sep 15, 2003 at 09:35:46PM -0700
52Sender: linux-kernel-owner@vger.kernel.org
53Precedence: bulk
54X-Mailing-List: linux-kernel@vger.kernel.org
55
56* David Yu Chen (dychen@stanford.edu) wrote:
57> [FILE: 2.6.0-test5/drivers/scsi/scsi_debug.c]
58> [FUNC: sdebug_add_adapter]
59> [LINES: 1612-1652]
60> [VAR: sdbg_devinfo]
61> 1607: memset(sdbg_host, 0, sizeof(*sdbg_host));
62> 1608: INIT_LIST_HEAD(&sdbg_host->dev_info_list);
63> 1609:
64> 1610: devs_per_host = scsi_debug_num_tgts * scsi_debug_max_luns;
65> 1611: for (k = 0; k < devs_per_host; k++) {
66> START -->
67> 1612: sdbg_devinfo = kmalloc(sizeof(*sdbg_devinfo),GFP_KERNEL);
68> 1613: if (NULL == sdbg_devinfo) {
69> 1614: printk(KERN_ERR "%s: out of memory at line %d\n",
70> 1615: __FUNCTION__, __LINE__);
71> 1616: error = -ENOMEM;
72> GOTO -->
73> 1617: goto clean1;
74> ... DELETED 29 lines ...
75> 1647: kfree(sdbg_devinfo);
76> 1648: }
77> 1649:
78> 1650:clean1:
79> 1651: kfree(sdbg_host);
80> END -->
81> 1652: return error;
82
83Yes, this could leak sdbg_devinfo structs. Patch below. James, look ok?
84
85thanks,
86-chris
87
88===== drivers/scsi/scsi_debug.c 1.44 vs edited =====
89--- 1.44/drivers/scsi/scsi_debug.c Fri Aug 15 10:07:53 2003
90+++ edited/drivers/scsi/scsi_debug.c Mon Sep 22 15:27:17 2003
91@@ -1614,7 +1614,7 @@
92 printk(KERN_ERR "%s: out of memory at line %d\n",
93 __FUNCTION__, __LINE__);
94 error = -ENOMEM;
95- goto clean1;
96+ goto clean;
97 }
98 memset(sdbg_devinfo, 0, sizeof(*sdbg_devinfo));
99 sdbg_devinfo->sdbg_host = sdbg_host;
100@@ -1634,12 +1634,12 @@
101 error = device_register(&sdbg_host->dev);
102
103 if (error)
104- goto clean2;
105+ goto clean;
106
107 ++scsi_debug_add_host;
108 return error;
109
110-clean2:
111+clean:
112 list_for_each_safe(lh, lh_sf, &sdbg_host->dev_info_list) {
113 sdbg_devinfo = list_entry(lh, struct sdebug_dev_info,
114 dev_list);
115@@ -1647,7 +1647,6 @@
116 kfree(sdbg_devinfo);
117 }
118
119-clean1:
120 kfree(sdbg_host);
121 return error;
122 }
123-
124To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
125the body of a message to majordomo@vger.kernel.org
126More majordomo info at http://vger.kernel.org/majordomo-info.html
127Please read the FAQ at http://www.tux.org/lkml/
128
This page took 0.16375 seconds and 4 git commands to generate.