[ACPI] Fix Null pointer deref in video/lcd/brightness
authorThomas Renninger <trenn@suse.de>
Tue, 8 Nov 2005 10:27:00 +0000 (05:27 -0500)
committerLen Brown <len.brown@intel.com>
Thu, 1 Dec 2005 04:03:08 +0000 (23:03 -0500)
http://bugzilla.kernel.org/show_bug.cgi?id=5571

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Yu Luming <luming.yu@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/video.c

index f051b151580d7de14647213f6c4497a75a4eff57..d10668f146997d07c53630b722d15fad2054ed98 100644 (file)
@@ -812,7 +812,7 @@ acpi_video_device_write_brightness(struct file *file,
 
        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))