mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
To: Julius Werner <jwerner@google.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Julius Werner <jwerner@chromium.org>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Vincent Palatin <vpalatin@chromium.org>
Subject: Re: [PATCH] xhci: fix null-pointer dereference when destroying half-built segment rings
Date: Mon, 12 Nov 2012 10:03:37 -0800	[thread overview]
Message-ID: <20121112180337.GB6217@xanatos> (raw)
In-Reply-To: <95F2AD07-450E-422C-AB0B-9DFC4734CA1C@google.com>

On Thu, Nov 01, 2012 at 01:28:46PM -0700, Julius Werner wrote:
> >> Is it just
> >> for (prev = *first; prev; prev = prev->next)
> >>    xhci_segment_free(xhci, prev);
> >> 
> >> ?
> > 
> > Yeah, that seems cleaner.
> > 
> > Sarah Sharp
> 
> I can submit it that way if you want, but I would advise against it. This way you access the prev pointer after it has been freed already… that's probably not a problem in the current kernel, but it depends on how the underlying memory is managed and is generally just not a good idea in my opinion.

Yep, you're right.  I'll take the second patch you submitted, thanks.

Sarah Sharp

      reply	other threads:[~2012-11-12 18:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-29 17:00 Julius Werner
2012-10-29 18:35 ` Sergei Shtylyov
2012-10-29 18:54   ` Julius Werner
2012-11-01 17:52   ` Sarah Sharp
2012-11-01 19:47     ` Julius Werner
2012-11-01 20:13       ` Andy Shevchenko
2012-11-01 20:15         ` Sarah Sharp
2012-11-01 20:28           ` Julius Werner
2012-11-12 18:03             ` Sarah Sharp [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=20121112180337.GB6217@xanatos \
    --to=sarah.a.sharp@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jwerner@chromium.org \
    --cc=jwerner@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=vpalatin@chromium.org \
    /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

all inboxes | Powered by JetHome®