Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=10270d4838bdc493781f5a1cf2e90e9c34c9142f
Commit:     10270d4838bdc493781f5a1cf2e90e9c34c9142f
Parent:     d897d2b597167586fcf1fb197ad5a1c23332c3e8
Author:     Linus Torvalds <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 13 09:56:14 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Feb 13 09:56:14 2008 -0800

    acpi: fix acpi_os_read_pci_configuration() misuse of raw_pci_read()
    
    The raw_pci_read() interface (as the raw_pci_ops->read() before it)
    unconditionally fills in a 32-bit integer return value regardless of the
    size of the operation requested.
    
    So claiming to take a "void *" is wrong, as is passing in a pointer to
    just a byte variable.
    
    Noticed by pageexec when enabling -fstack-protector (which needs other
    patches too to actually work, but that's a separate issue).
    
    Acked-by: Len Brown <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/acpi/osl.c      |   16 ++++++++--------
 include/acpi/acpiosxf.h |    2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 34b3386..15e6023 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -623,7 +623,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 
value, u32 width)
 
 acpi_status
 acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg,
-                              void *value, u32 width)
+                              u32 *value, u32 width)
 {
        int result, size;
 
@@ -689,7 +689,6 @@ static void acpi_os_derive_pci_id_2(acpi_handle rhandle,    
/* upper bound  */
        acpi_status status;
        unsigned long temp;
        acpi_object_type type;
-       u8 tu8;
 
        acpi_get_parent(chandle, &handle);
        if (handle != rhandle) {
@@ -704,6 +703,7 @@ static void acpi_os_derive_pci_id_2(acpi_handle rhandle,    
/* upper bound  */
                    acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL,
                                          &temp);
                if (ACPI_SUCCESS(status)) {
+                       u32 val;
                        pci_id->device = ACPI_HIWORD(ACPI_LODWORD(temp));
                        pci_id->function = ACPI_LOWORD(ACPI_LODWORD(temp));
 
@@ -712,24 +712,24 @@ static void acpi_os_derive_pci_id_2(acpi_handle rhandle,  
/* upper bound  */
 
                        /* any nicer way to get bus number of bridge ? */
                        status =
-                           acpi_os_read_pci_configuration(pci_id, 0x0e, &tu8,
+                           acpi_os_read_pci_configuration(pci_id, 0x0e, &val,
                                                           8);
                        if (ACPI_SUCCESS(status)
-                           && ((tu8 & 0x7f) == 1 || (tu8 & 0x7f) == 2)) {
+                           && ((val & 0x7f) == 1 || (val & 0x7f) == 2)) {
                                status =
                                    acpi_os_read_pci_configuration(pci_id, 0x18,
-                                                                  &tu8, 8);
+                                                                  &val, 8);
                                if (!ACPI_SUCCESS(status)) {
                                        /* Certainly broken...  FIX ME */
                                        return;
                                }
                                *is_bridge = 1;
-                               pci_id->bus = tu8;
+                               pci_id->bus = val;
                                status =
                                    acpi_os_read_pci_configuration(pci_id, 0x19,
-                                                                  &tu8, 8);
+                                                                  &val, 8);
                                if (ACPI_SUCCESS(status)) {
-                                       *bus_number = tu8;
+                                       *bus_number = val;
                                }
                        } else
                                *is_bridge = 0;
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 022a5fd..4839f2a 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -222,7 +222,7 @@ acpi_os_write_memory(acpi_physical_address address, u32 
value, u32 width);
  */
 acpi_status
 acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id,
-                              u32 reg, void *value, u32 width);
+                              u32 reg, u32 *value, u32 width);
 
 acpi_status
 acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id,
-
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