[patch 05/19] apci: fix NULL deref in video/lcd/brightness

Greg Kroah-Hartman
2005-12-23T22:54:54Z

[-- Attachment #1: acpi-fix-null-deref-in-video-lcd-brightness.patch --]
[-- Type: text/plain, Size: 1024 bytes --]

-stable review patch. If anyone has any objections, please let us know.

------------------
From: Yu Luming <luming.yu@gmail.com>

Fix Null pointer deref in video/lcd/brightness
http://bugzilla.kernel.org/show_bug.cgi?id=5571

Signed-off-by: Yu Luming <luming.yu@gmail.com>
Cc: "Brown, Len" <len.brown@intel.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@redhat.com>
---
drivers/acpi/video.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.14.4.orig/drivers/acpi/video.c
+++ linux-2.6.14.4/drivers/acpi/video.c
@@ -813,7 +813,7 @@ acpi_video_device_write_brightness(struc

ACPI_FUNCTION_TRACE("acpi_video_device_write_brightness");

- if (!dev || count + 1 > sizeof str)
+ if (!dev || !dev->brightness || count + 1 > sizeof str)
return_VALUE(-EINVAL);

if (copy_from_user(str, buffer, count))

--