Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1701263ybl; Sat, 25 Jan 2020 06:36:31 -0800 (PST) X-Google-Smtp-Source: APXvYqzjfiJL0M372udFHwlROEKmGsEX5+ElrDTg+cusmrgDz5oqCCTaSH4GJJlx+1i9EmYvkq4D X-Received: by 2002:a9d:6c0d:: with SMTP id f13mr6229008otq.354.1579962991015; Sat, 25 Jan 2020 06:36:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579962991; cv=none; d=google.com; s=arc-20160816; b=NW44KsjmYFtUcP8AcJYwk2ZFVt82RUjBS+L/AgdQCM34lM1QP4Ux2xr9xmL+TZvg1X EFh7fPMNrKBNHenQZeqIJ5zVfkw/QIZjH/NMjZfHkPtUGyD7aYj946z53Pd7Z4e9ij72 6PFwTVMbBjPYy7yjilYKA1cIxgky5ZTm2h3o7UgmNGj1Hj1uAs/Q+DQ8eHN+Uuc9lAK7 7sTeYx/GwRIFSRR5YXrrg82IZCx4h4oegThG1OEiASfP3GmI7yPuiR5bQUHJkZZkW/hD D8evTQNTupjEZYoDJP5nFoy+JkUM0PMCpTeIzvDhD7+ZK54Mb1IQYdDp21O9oRDAnoB5 SfHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=6V6DO41XCuS31suMRuLbqvXff3FIB9saxTLikHIH8r4=; b=H8lCEGl7DEUsiUUSSzro420vYQ6sHSs4POauLVeJxiSVP1hNPcW/M/KI7UDZLwsigO PjokCTrmqVBXdmMtGzBAGGAkqxiNDmupbUm9QqW2NJ8WIYE8fTEe88cGooPCGVjR4kKo yDjZTIUVqUkl9g3ja5VVrzWh0Y2OWMhS4tKMeHUvKDNcn6tfR3WW2RPd+PV5LaLqP7rd ngi1bt68ingPhsFWw9j29ihofSt50S3Em5UzCgTA44FT9iQ7j0TJulTsrvq8jTmDFT94 8LS1bamQZF3g/bkCQehrkJGBJyaW0YRIKcXt1cvfPfDQmRhmuopgWGuGAXhuGvVPZoxl 6ayA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k10si1234101oik.276.2020.01.25.06.36.19; Sat, 25 Jan 2020 06:36:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727084AbgAYOex (ORCPT + 99 others); Sat, 25 Jan 2020 09:34:53 -0500 Received: from ajax.cs.uga.edu ([128.192.4.6]:56602 "EHLO ajax.cs.uga.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbgAYOex (ORCPT ); Sat, 25 Jan 2020 09:34:53 -0500 X-Greylist: delayed 1323 seconds by postgrey-1.27 at vger.kernel.org; Sat, 25 Jan 2020 09:34:52 EST Received: from mail-ua1-f49.google.com (mail-ua1-f49.google.com [209.85.222.49]) (authenticated bits=0) by ajax.cs.uga.edu (8.14.4/8.14.4) with ESMTP id 00PECmTu053411 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 25 Jan 2020 09:12:48 -0500 Received: by mail-ua1-f49.google.com with SMTP id x16so1853415uao.11; Sat, 25 Jan 2020 06:12:48 -0800 (PST) X-Gm-Message-State: APjAAAUEYmRUA4Gd1zEye2vC/zDyq9hZNNtt1D5rGlhWhx7f9GCfhCKY GrJh5W4vlImCLGB4R+NSH/fLDz5ve93NKPWISk4= X-Received: by 2002:ab0:2150:: with SMTP id t16mr4683359ual.61.1579961567761; Sat, 25 Jan 2020 06:12:47 -0800 (PST) MIME-Version: 1.0 References: <20200125051134.11557-1-wenwen@cs.uga.edu> <20200125.081107.914737890991760251.davem@davemloft.net> In-Reply-To: <20200125.081107.914737890991760251.davem@davemloft.net> From: Wenwen Wang Date: Sat, 25 Jan 2020 09:12:11 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] firestream: fix memory leaks To: David Miller Cc: Chas Williams <3chas3@gmail.com>, "moderated list:ATM" , "open list:NETWORKING [GENERAL]" , open list , Wenwen Wang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 25, 2020 at 2:11 AM David Miller wrote: > > From: Wenwen Wang > Date: Sat, 25 Jan 2020 05:11:34 +0000 > > > @@ -922,6 +923,7 @@ static int fs_open(struct atm_vcc *atm_vcc) > > if (((DO_DIRECTION(rxtp) && dev->atm_vccs[vcc->channo])) || > > ( DO_DIRECTION(txtp) && test_bit (vcc->channo, dev->tx_inuse))) { > > printk ("Channel is in use for FS155.\n"); > > + kfree(vcc); > > return -EBUSY; > > } > > } > > -- > > There is another case just below this line: > > tc, sizeof (struct fs_transmit_config)); > if (!tc) { > fs_dprintk (FS_DEBUG_OPEN, "fs: can't alloc transmit_config.\n"); > return -ENOMEM; > } > > Please audit the entire function and make sure your patch fixes all of these > missing vcc free cases. Thanks for your comment! I was planning to submit another patch as this case has different semantics. But, since you have pointed out, I will revise this patch. Wenwen > > Thank you.