Don't leave Value32 uinitialized (as it's not completely filled)
authorMagliano Andrea <masterblaster@tiscali.it>
Tue, 1 Mar 2011 07:42:05 +0000 (08:42 +0100)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 27 Mar 2011 10:34:00 +0000 (18:34 +0800)
OsdHardware.c:AcpiOsReadPort() casts Value to (u_int8_t *) resp.
(u_int16_t *) when assigning, thus leaving the upper region of Value32
untouched. If Value32 isn't initialized, random data remains trashing
the whole value.

Without this every bus_space_read_[12] is virtually screwed up.

sys/contrib/dev/acpica-unix/executer/exregion.c

index 2a308db..75e3a85 100644 (file)
@@ -388,7 +388,7 @@ AcpiExSystemIoSpaceHandler (
     void                    *RegionContext)
 {
     ACPI_STATUS             Status = AE_OK;
-    UINT32                  Value32;
+    UINT32                  Value32 = 0;
 
 
     ACPI_FUNCTION_TRACE (ExSystemIoSpaceHandler);