From 5e4fbe091dac9a8f07567f511f5ef50bef28addc Mon Sep 17 00:00:00 2001 From: Paul Keith Date: Fri, 21 Apr 2017 21:34:17 -0500 Subject: [PATCH] power: Sanity check touchscreen path * Let's not always assume this isn't NULL Change-Id: I181cb014fc06d0f0ca795c3ecc374ccf9dbb57f1 Signed-off-by: Paul Keith --- power/power.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/power/power.c b/power/power.c index e46a53eb..54edcf2d 100644 --- a/power/power.c +++ b/power/power.c @@ -382,7 +382,10 @@ static void samsung_power_set_interactive(struct power_module *module, int on) } } - sysfs_write(samsung_pwr->touchscreen_power_path, on ? "1" : "0"); + /* Sanity check the touchscreen path */ + if (samsung_pwr->touchscreen_power_path) { + sysfs_write(samsung_pwr->touchscreen_power_path, on ? "1" : "0"); + } /* Bail out if the device does not have touchkeys */ if (samsung_pwr->touchkey_power_path == NULL) {