diff options
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index f6e54bf8dd96..05dff631591c 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -1109,7 +1109,12 @@ static int acpi_video_bus_check(struct acpi_video_bus *video) | |||
1109 | */ | 1109 | */ |
1110 | 1110 | ||
1111 | /* Does this device support video switching? */ | 1111 | /* Does this device support video switching? */ |
1112 | if (video->cap._DOS) { | 1112 | if (video->cap._DOS || video->cap._DOD) { |
1113 | if (!video->cap._DOS) { | ||
1114 | printk(KERN_WARNING FW_BUG | ||
1115 | "ACPI(%s) defines _DOD but not _DOS\n", | ||
1116 | acpi_device_bid(video->device)); | ||
1117 | } | ||
1113 | video->flags.multihead = 1; | 1118 | video->flags.multihead = 1; |
1114 | status = 0; | 1119 | status = 0; |
1115 | } | 1120 | } |
@@ -1218,7 +1223,7 @@ acpi_video_device_write_state(struct file *file, | |||
1218 | u32 state = 0; | 1223 | u32 state = 0; |
1219 | 1224 | ||
1220 | 1225 | ||
1221 | if (!dev || count + 1 > sizeof str) | 1226 | if (!dev || count >= sizeof(str)) |
1222 | return -EINVAL; | 1227 | return -EINVAL; |
1223 | 1228 | ||
1224 | if (copy_from_user(str, buffer, count)) | 1229 | if (copy_from_user(str, buffer, count)) |
@@ -1275,7 +1280,7 @@ acpi_video_device_write_brightness(struct file *file, | |||
1275 | int i; | 1280 | int i; |
1276 | 1281 | ||
1277 | 1282 | ||
1278 | if (!dev || !dev->brightness || count + 1 > sizeof str) | 1283 | if (!dev || !dev->brightness || count >= sizeof(str)) |
1279 | return -EINVAL; | 1284 | return -EINVAL; |
1280 | 1285 | ||
1281 | if (copy_from_user(str, buffer, count)) | 1286 | if (copy_from_user(str, buffer, count)) |
@@ -1557,7 +1562,7 @@ acpi_video_bus_write_POST(struct file *file, | |||
1557 | unsigned long long opt, options; | 1562 | unsigned long long opt, options; |
1558 | 1563 | ||
1559 | 1564 | ||
1560 | if (!video || count + 1 > sizeof str) | 1565 | if (!video || count >= sizeof(str)) |
1561 | return -EINVAL; | 1566 | return -EINVAL; |
1562 | 1567 | ||
1563 | status = acpi_video_bus_POST_options(video, &options); | 1568 | status = acpi_video_bus_POST_options(video, &options); |
@@ -1597,7 +1602,7 @@ acpi_video_bus_write_DOS(struct file *file, | |||
1597 | unsigned long opt; | 1602 | unsigned long opt; |
1598 | 1603 | ||
1599 | 1604 | ||
1600 | if (!video || count + 1 > sizeof str) | 1605 | if (!video || count >= sizeof(str)) |
1601 | return -EINVAL; | 1606 | return -EINVAL; |
1602 | 1607 | ||
1603 | if (copy_from_user(str, buffer, count)) | 1608 | if (copy_from_user(str, buffer, count)) |