public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lin Ming <ming.m.lin@intel.com>
To: Len Brown <lenb@kernel.org>
Cc: Bob Moore <robert.moore@intel.com>,
	Jesper Juhl <jj@chaosbits.net>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ACPI, psargs: Fix small mem leaks on error paths
Date: Sat, 31 Mar 2012 08:56:43 +0800	[thread overview]
Message-ID: <1333155403.2939.0.camel@minggr> (raw)
In-Reply-To: <4F755CAC.9070209@kernel.org>

We have ported this patch into ACPICA tree.

On Fri, 2012-03-30 at 03:11 -0400, Len Brown wrote:
> Bob?
> 
> On 02/04/2012 08:12 PM, Jesper Juhl wrote:
> 
> > As far as I can see, there are two small mem leaks in error paths of
> > 'acpi_ps_get_next_field()' where we neglect to free the memory
> > previously allocated to 'field'.
> > 
> > I believe this patch should fix the leaks.
> > 
> > Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> > ---
> >  drivers/acpi/acpica/psargs.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> >  Note: Compile tested only.
> > 
> > diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c
> > index 5ac36ab..a683d66 100644
> > --- a/drivers/acpi/acpica/psargs.c
> > +++ b/drivers/acpi/acpica/psargs.c
> > @@ -618,6 +618,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
> >  
> >  				arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP);
> >  				if (!arg) {
> > +					acpi_ps_free_op(field);
> >  					return_PTR(NULL);
> >  				}
> >  
> > @@ -662,6 +663,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
> >  		} else {
> >  			arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP);
> >  			if (!arg) {
> > +				acpi_ps_free_op(field);
> >  				return_PTR(NULL);
> >  			}
> >  
> 
> 



      reply	other threads:[~2012-03-31  0:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-05  1:12 [PATCH] ACPI, psargs: Fix small mem leaks on error paths Jesper Juhl
2012-03-19 22:11 ` Jesper Juhl
2012-03-30  7:11 ` Len Brown
2012-03-31  0:56   ` Lin Ming [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1333155403.2939.0.camel@minggr \
    --to=ming.m.lin@intel.com \
    --cc=jj@chaosbits.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robert.moore@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox