lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1488975747-32184-1-git-send-email-arvind.yadav.cs@gmail.com>
Date:   Wed,  8 Mar 2017 17:52:27 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     mjg59@...f.ucam.org, pali.rohar@...il.com, dvhart@...radead.org,
        andy@...radead.org
Cc:     platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] platform/x86: dell-laptop: Handle return error form dell_get_intensity.

Here, dell_get_intensity can return an error. So we can assgine
props.brightness as max_brightness.

This change is done using Coccinelle.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
 drivers/platform/x86/dell-laptop.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index f57dd28..0891de3 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -2053,6 +2053,9 @@ static int __init dell_init(void)
 
 		dell_backlight_device->props.brightness =
 			dell_get_intensity(dell_backlight_device);
+		if (dell_backlight_device->props.brightness < 0) {
+			dell_backlight_device->props.brightness = props.max_brightness;
+		}
 		backlight_update_status(dell_backlight_device);
 	}
 
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ