From: Kenji Kaneshige <kaneshige.kenji-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
To: Andrew Morton <akpm-3NddpPZAyC0@public.gmane.org>,
Len Brown <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: Kenji Kaneshige
<kaneshige.kenji-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
Subject: [PATCH 2.6.13-rc4 1/2] fix possible null pointer access - acpi_pci_irq_enable
Date: Mon, 01 Aug 2005 12:34:08 +0900 [thread overview]
Message-ID: <42ED9830.7060808@jp.fujitsu.com> (raw)
In-Reply-To: <42ED97C2.7060409-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
This patch fixes possible null pointer access in acpi_pci_irq_enable.
The 'bus' field in pci_dev structure should be checked before calling
pci_read_config_byte() because pci_bus_read_config_byte() called by
pci_read_config_byte() refers to 'bus' field.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
---
drivers/acpi/pci_irq.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff -puN drivers/acpi/pci_irq.c~fix-possible-null-pointer-access-acpi_pci_irq_enable drivers/acpi/pci_irq.c
--- linux-2.6.13-rc4/drivers/acpi/pci_irq.c~fix-possible-null-pointer-access-acpi_pci_irq_enable 2005-08-01 12:20:26.000000000 +0900
+++ linux-2.6.13-rc4-kanesige/drivers/acpi/pci_irq.c 2005-08-01 12:20:26.000000000 +0900
@@ -397,6 +397,11 @@ acpi_pci_irq_enable (
if (!dev)
return_VALUE(-EINVAL);
+
+ if (!dev->bus) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) 'bus' field\n"));
+ return_VALUE(-ENODEV);
+ }
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
if (!pin) {
@@ -405,11 +410,6 @@ acpi_pci_irq_enable (
}
pin--;
- if (!dev->bus) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) 'bus' field\n"));
- return_VALUE(-ENODEV);
- }
-
/*
* First we check the PCI IRQ routing table (PRT) for an IRQ. PRT
* values override any BIOS-assigned IRQs set during boot.
_
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
next prev parent reply other threads:[~2005-08-01 3:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-01 3:32 [PATCH 2.6.13-rc4 0/2] fix possible null pointer access in acpi_pci_irq_{enable, disable} Kenji Kaneshige
[not found] ` <42ED97C2.7060409-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2005-08-01 3:34 ` Kenji Kaneshige [this message]
[not found] ` <42ED9830.7060808-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2005-08-03 11:36 ` [PATCH 2.6.13-rc4 1/2] fix possible null pointer access - acpi_pci_irq_enable Pavel Machek
[not found] ` <20050803113637.GB4038-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-08-05 1:34 ` Kenji Kaneshige
[not found] ` <42F2C20F.4050807-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2005-08-05 7:19 ` Pavel Machek
[not found] ` <20050805071918.GG1780-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-08-08 4:24 ` Kenji Kaneshige
[not found] ` <42F6DE69.5090101-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2005-08-08 5:07 ` Andrew Morton
2005-08-01 3:35 ` [PATCH 2.6.13-rc4 2/2] fix possible null pointer access - acpi_pci_irq_disable Kenji Kaneshige
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=42ED9830.7060808@jp.fujitsu.com \
--to=kaneshige.kenji-+cum20s59erqfuhtdcdx3a@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=akpm-3NddpPZAyC0@public.gmane.org \
--cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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