From: Arvind Yadav Date: Thu, 9 Mar 2017 05:49:56 +0000 (+0530) Subject: platform/x86: dell-laptop: Handle return error form dell_get_intensity. X-Git-Tag: v4.14-rc1~997^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90a864b965e452ee2a15ed7b13f47142aeb4a40b;p=platform%2Fkernel%2Flinux-rpi.git 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 Acked-by: Pali Rohár Signed-off-by: Andy Shevchenko --- diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index 47fe626..296cb96 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: