mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julius Werner <jwerner@google.com>
To: Sarah Sharp <sarah.a.sharp@linux.intel.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: Thu, 1 Nov 2012 13:28:46 -0700	[thread overview]
Message-ID: <95F2AD07-450E-422C-AB0B-9DFC4734CA1C@google.com> (raw)
In-Reply-To: <20121101201552.GA9472@xanatos>

>> 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.

  reply	other threads:[~2012-11-01 20:28 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 [this message]
2012-11-12 18:03             ` Sarah Sharp

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=95F2AD07-450E-422C-AB0B-9DFC4734CA1C@google.com \
    --to=jwerner@google.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jwerner@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sarah.a.sharp@linux.intel.com \
    --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®