Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3d9befd2cdf65b1768b0d3078a65cc0ae9aa6412
Commit:     3d9befd2cdf65b1768b0d3078a65cc0ae9aa6412
Parent:     05dfa35e84331c6921ab394463069e9376f0bd76
Author:     Yinghai Lu <[EMAIL PROTECTED]>
AuthorDate: Sat Nov 17 16:27:01 2007 +0100
Committer:  Thomas Gleixner <[EMAIL PROTECTED](none)>
CommitDate: Sat Nov 17 16:27:01 2007 +0100

    x86: check boundary in count setup resource
    
    need to check info->res_num less than PCI_BUS_NUM_RESOURCES, so
    info->bus->resource[info->res_num] = res will not beyond of bus resource
    array when acpi returns too many resource entries.
    
    Signed-off-by: Yinghai Lu <[EMAIL PROTECTED]>
    Cc: Greg Kroah-Hartman <[EMAIL PROTECTED]>
    Cc: Gary Hade <[EMAIL PROTECTED]>
    Cc: Len Brown <[EMAIL PROTECTED]>
    Cc: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/pci/acpi.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 2d88f7c..7e35078 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -77,6 +77,9 @@ count_resource(struct acpi_resource *acpi_res, void *data)
        struct acpi_resource_address64 addr;
        acpi_status status;
 
+       if (info->res_num >= PCI_BUS_NUM_RESOURCES)
+               return AE_OK;
+
        status = resource_to_addr(acpi_res, &addr);
        if (ACPI_SUCCESS(status))
                info->res_num++;
@@ -93,6 +96,9 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
        unsigned long flags;
        struct resource *root;
 
+       if (info->res_num >= PCI_BUS_NUM_RESOURCES)
+               return AE_OK;
+
        status = resource_to_addr(acpi_res, &addr);
        if (!ACPI_SUCCESS(status))
                return AE_OK;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to