Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758949AbZGIAU5 (ORCPT ); Wed, 8 Jul 2009 20:20:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754661AbZGIAUu (ORCPT ); Wed, 8 Jul 2009 20:20:50 -0400 Received: from mail-px0-f193.google.com ([209.85.216.193]:60154 "EHLO mail-px0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754743AbZGIAUu convert rfc822-to-8bit (ORCPT ); Wed, 8 Jul 2009 20:20:50 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=RN5YMALQ08LitR8jRuJ4cFQfzaLXajDniqu9amm6s3YINqOI9U+RylUVAZycwwqpVx Z6IQ2GHqbA7ZWnsBMxdoJ94r8sW5pfarrxuuPdMv4w3UBx57hwOoJ+N1usCPadr6N39B aSX3FAtRDgJz9Dthn+GGeZxlahJPezgo0Izxo= MIME-Version: 1.0 In-Reply-To: <1247098591-4887-1-git-send-email-tom.leiming@gmail.com> References: <1247098591-4887-1-git-send-email-tom.leiming@gmail.com> Date: Thu, 9 Jul 2009 08:20:48 +0800 Message-ID: Subject: Re: [PATCH] driver core:firmware_class:fix memory leak of page pointers array From: Ming Lei To: greg@kroah.com Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com, dwmw2@infradead.org, kay.sievers@vrfy.org, Ming Lei Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1491 Lines: 45 2009/7/9 : > From: Ming Lei > > The page pointers array is allocated in fw_realloc_buffer() called by > firmware_data_write(), and should be freed in release function of firmware > device. > > Signed-off-by:Ming Lei > Reported-by:Catalin Marinas > Acked-by: David Woodhouse --- This patch is against Catalin Marinas's patch: [PATCH] Free struct device in fw_dev_release() > --- > ?drivers/base/firmware_class.c | ? ?1 - > ?1 files changed, 0 insertions(+), 1 deletions(-) > > diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c > index fc46653..2643366 100644 > --- a/drivers/base/firmware_class.c > +++ b/drivers/base/firmware_class.c > @@ -180,7 +180,6 @@ static ssize_t firmware_loading_store(struct device *dev, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?goto err; > ? ? ? ? ? ? ? ? ? ? ? ?} > ? ? ? ? ? ? ? ? ? ? ? ?/* Pages will be freed by vfree() */ > - ? ? ? ? ? ? ? ? ? ? ? fw_priv->pages = NULL; > ? ? ? ? ? ? ? ? ? ? ? ?fw_priv->page_array_size = 0; > ? ? ? ? ? ? ? ? ? ? ? ?fw_priv->nr_pages = 0; > ? ? ? ? ? ? ? ? ? ? ? ?complete(&fw_priv->completion); > -- > 1.6.0.GIT > > -- Lei Ming -- 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/