summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-03-09 06:49:56 +0100
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-04-28 20:51:26 +0200
commit90a864b965e452ee2a15ed7b13f47142aeb4a40b (patch)
treeec8286d8fbde2f33c1a16db93e82c8f437b1430f /drivers/platform
parentplatform/x86: hp-wireless: reuse module_acpi_driver (diff)
downloadlinux-90a864b965e452ee2a15ed7b13f47142aeb4a40b.tar.xz
linux-90a864b965e452ee2a15ed7b13f47142aeb4a40b.zip
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.c6
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: