linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Juhl <jj@chaosbits.net>
To: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Alan Cox <alan@linux.intel.com>
Subject: Re: [PATCH] intel, gma500, lvds: Fix use after free and mem leak in psb_intel_lvds_init()
Date: Wed, 18 Jan 2012 00:20:03 +0100 (CET)	[thread overview]
Message-ID: <alpine.LNX.2.00.1201180019260.23966@swampdragon.chaosbits.net> (raw)
In-Reply-To: <CAMeQTsZqG5u46Ht+vew+idC-ZPwLM+K_OtEfpD0pmiobXzWNig@mail.gmail.com>

On Tue, 17 Jan 2012, Patrik Jakobsson wrote:

> On Sat, Jan 14, 2012 at 10:15 PM, Jesper Juhl wrote:
> > In psb_intel_lvds_init(), if we fail to allocate memory for
> > 'psb_intel_connector' we free the memory we previously allocated for
> > 'psb_intel_encoder', but we then proceed to use that free'd pointer
> > when we do 'psb_intel_encoder->dev_priv = lvds_priv;'.
> >
> > We may also leak the memory we allocated for 'psb_intel_encoder' if we
> > 'goto failed_connector;' and the variable goes out of scope.
> >
> > While I was there anyway, I also removed the pointless 'if
> > (psb_intel_connector)' before freeing it at the 'failed_connector:'
> > label - kfree() deals gracefully with NULL pointers, so it is not
> > needed.
> 
> My bad, thanks for fixing

No problem :-) Now I just hope that it will get merged :-)

-- 
Jesper Juhl <jj@chaosbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.


      reply	other threads:[~2012-01-17 23:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-14 19:59 [PATCH] intel, gma500, lvds: Fix use after free on psb_intel_lvds_init() Jesper Juhl
2012-01-14 20:58 ` Jesper Juhl
2012-01-14 21:15   ` [PATCH] intel, gma500, lvds: Fix use after free and mem leak in psb_intel_lvds_init() Jesper Juhl
2012-01-17 10:15     ` Patrik Jakobsson
2012-01-17 23:20       ` Jesper Juhl [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=alpine.LNX.2.00.1201180019260.23966@swampdragon.chaosbits.net \
    --to=jj@chaosbits.net \
    --cc=alan@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patrik.r.jakobsson@gmail.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;
as well as URLs for NNTP newsgroup(s).