diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2017-03-09 11:19:56 +0530 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-04-28 21:51:26 +0300 |
commit | 90a864b965e452ee2a15ed7b13f47142aeb4a40b (patch) | |
tree | ec8286d8fbde2f33c1a16db93e82c8f437b1430f /drivers/platform | |
parent | 0b8dba15e909990e275631fa57255e74bbc766fc (diff) | |
download | linux-90a864b965e452ee2a15ed7b13f47142aeb4a40b.tar.bz2 |
platform/x86: dell-laptop: Handle return error form dell_get_intensity.
Here, This patch is to handle a return error from dell_get_intensity.
This change is done using Coccinelle.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/dell-laptop.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index 47fe6264cadf..296cb9632a71 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c @@ -2151,11 +2151,17 @@ static int __init dell_init(void) dell_backlight_device->props.brightness = dell_get_intensity(dell_backlight_device); + if (dell_backlight_device->props.brightness < 0) { + ret = dell_backlight_device->props.brightness; + goto fail_get_brightness; + } backlight_update_status(dell_backlight_device); } return 0; +fail_get_brightness: + backlight_device_unregister(dell_backlight_device); fail_backlight: dell_cleanup_rfkill(); fail_rfkill: |