From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Jesper Juhl <jj@chaosbits.net>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: Avoid potential NULL pointer dereference in pci_scan_bridge
Date: Tue, 8 Feb 2011 13:10:43 -0800 [thread overview]
Message-ID: <20110208131043.3b1ca905@jbarnes-desktop> (raw)
In-Reply-To: <alpine.LNX.2.00.1101242108220.10252@swampdragon.chaosbits.net>
On Mon, 24 Jan 2011 21:14:33 +0100 (CET)
Jesper Juhl <jj@chaosbits.net> wrote:
> pci_add_new_bus() calls pci_alloc_child_bus() which calls pci_alloc_bus()
> that allocates memory dynamically with kzalloc(). The return value of
> kzalloc() is the pointer that's eventually returned from
> pci_add_new_bus(), so since kzalloc() can fail and return NULL so can
> pci_add_new_bus(). Thus we may end up dereferencing a NULL pointer in
> drivers/pci/probe.c::pci_scan_bridge(). Seems to me we should test for
> this and bail out if it happens rather than crashing.
> Also removed some trailing whitespace that bugged me while looking at
> this.
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> ---
Applied to linux-next (in the absence of actual reports I'll be
conservative), thanks.
--
Jesse Barnes, Intel Open Source Technology Center
prev parent reply other threads:[~2011-02-08 21:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-24 20:14 Jesper Juhl
2011-02-08 21:10 ` Jesse Barnes [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=20110208131043.3b1ca905@jbarnes-desktop \
--to=jbarnes@virtuousgeek.org \
--cc=jj@chaosbits.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.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®