From 0ca551be3692a09328c3e4decf509b4abd840db6 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 24 Nov 2020 10:52:07 -0700 Subject: [PATCH] Fix ignored error when creating polling task --- system76_input.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/system76_input.c b/system76_input.c index 2a88a46..9ad0d1d 100644 --- a/system76_input.c +++ b/system76_input.c @@ -107,6 +107,8 @@ static void s76_input_screen_wmi(void) { } static int s76_input_open(struct input_dev *dev) { + int res = 0; + // Run polling thread if AP key driver is used and WMI is not supported if ((driver_flags & (DRIVER_AP_KEY | DRIVER_AP_WMI)) == DRIVER_AP_KEY) { s76_input_polling_task = kthread_run( @@ -114,13 +116,14 @@ static int s76_input_open(struct input_dev *dev) { NULL, "system76-polld"); if (unlikely(IS_ERR(s76_input_polling_task))) { + res = PTR_ERR(s76_input_polling_task); s76_input_polling_task = NULL; - S76_ERROR("Could not create polling thread\n"); - return PTR_ERR(s76_input_polling_task); + S76_ERROR("Could not create polling thread: %d\n", res); + return res; } } - return 0; + return res; } static void s76_input_close(struct input_dev *dev) {