aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
authorWilliam Lee Irwin III <wli@holomorphy.com>2007-12-12 06:56:55 -0500
committerLen Brown <len.brown@intel.com>2007-12-13 16:24:10 -0500
commit98934def70b48dac74fac3738b78ab2d1a28edda (patch)
tree75d97b7fb0dc47f19ad2ef5521fe69036ddfac60 /drivers/acpi/video.c
parentda8cadb31b82c9d41fc593c8deab6aa20b162d6b (diff)
ACPI: video_device_list corruption
The ->cap fields of struct acpi_video_device and struct acpi_video_bus are 1B each, not 4B. The oversized memset()'s corrupted the subsequent list_head fields. This resulted in silent corruption without CONFIG_DEBUG_LIST and BUG's with it. This patch uses sizeof() to pass the proper bounds to the memset() calls and thereby correct the bugs. Signed-off-by: William Irwin <wli@holomorphy.com> Acked-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r--drivers/acpi/video.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 44a0d9ba9bd6..bd77e81e81c1 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -577,7 +577,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
577 struct acpi_video_device_brightness *br = NULL; 577 struct acpi_video_device_brightness *br = NULL;
578 578
579 579
580 memset(&device->cap, 0, 4); 580 memset(&device->cap, 0, sizeof(device->cap));
581 581
582 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_ADR", &h_dummy1))) { 582 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_ADR", &h_dummy1))) {
583 device->cap._ADR = 1; 583 device->cap._ADR = 1;
@@ -697,7 +697,7 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video)
697{ 697{
698 acpi_handle h_dummy1; 698 acpi_handle h_dummy1;
699 699
700 memset(&video->cap, 0, 4); 700 memset(&video->cap, 0, sizeof(video->cap));
701 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) { 701 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) {
702 video->cap._DOS = 1; 702 video->cap._DOS = 1;
703 } 703 }