From: Andrew Patterson <andrew.patterson@hp.com>
To: Alex Chiang <achiang@hp.com>
Cc: jbarnes@virtuousgeek.org, matthew@wil.cx,
linux-pci <linux-pci@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PCIe: AER: during disable, check subordinate before walking
Date: Fri, 06 Mar 2009 13:17:05 -0700 [thread overview]
Message-ID: <1236370625.1168.7.camel@localhost> (raw)
In-Reply-To: <20090306022840.GC30103@ldl.fc.hp.com>
On Thu, 2009-03-05 at 19:28 -0700, Alex Chiang wrote:
> Commit 47a8b0cc (Enable PCIe AER only after checking firmware
> support) wants to walk the PCI bus in the remove path to disable
> AER, and calls pci_walk_bus for downstream bridges.
>
> Unfortunately, in the remove path, we remove devices and bridges
> in a depth-first manner, starting with the furthest downstream
> bridge and working our way backwards.
>
> The furthest downstream bridges will not have a dev->subordinate,
> and we hit a NULL deref in pci_walk_bus.
>
> Check for dev->subordinate first before attempting to walk the
> PCI hierarchy below us.
>
Looks good.
Acked-by: Andrew Patterson <andrew.patterson@hp.com>
> Cc: Andrew Patterson <andrew.patterson@hp.com>
> Signed-off-by: Alex Chiang <achiang@hp.com>
> ---
> Willy, this is .29 material, please push to Linus, thanks.
>
> ---
> diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c
> index aebb5f6..677d680 100644
> --- a/drivers/pci/pcie/aer/aerdrv_core.c
> +++ b/drivers/pci/pcie/aer/aerdrv_core.c
> @@ -133,6 +133,9 @@ static void set_downstream_devices_error_reporting(struct pci_dev *dev,
> bool enable)
> {
> set_device_error_reporting(dev, &enable);
> +
> + if (!dev->subordinate)
> + return;
> pci_walk_bus(dev->subordinate, set_device_error_reporting, &enable);
> }
>
--
Andrew Patterson
Hewlett-Packard Company
prev parent reply other threads:[~2009-03-06 20:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-06 2:28 [PATCH] PCIe: AER: during disable, check subordinate before walking Alex Chiang
2009-03-06 20:17 ` Andrew Patterson [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=1236370625.1168.7.camel@localhost \
--to=andrew.patterson@hp.com \
--cc=achiang@hp.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=matthew@wil.cx \
/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