[Wily][PATCH 2/3] HID: lenovo: Add missing return-value check

Joseph Salisbury joseph.salisbury at canonical.com
Wed Oct 21 15:36:55 UTC 2015


From: Jamie Lentin <jm at lentin.co.uk>

BugLink: http://bugs.launchpad.net/bugs/1508178

Signed-off-by: Jamie Lentin <jm at lentin.co.uk>
Signed-off-by: Jiri Kosina <jkosina at suse.cz>
(cherry picked from commit dbfebb44b7c650dd134a8be07f9afd5862150987)
Signed-off-by: Joseph Salisbury <joseph.salisbury at canonical.com>
---
 drivers/hid/hid-lenovo.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c
index 680bb11..d40221d 100644
--- a/drivers/hid/hid-lenovo.c
+++ b/drivers/hid/hid-lenovo.c
@@ -207,9 +207,12 @@ static void lenovo_features_set_cptkbd(struct hid_device *hdev)
 	struct lenovo_drvdata_cptkbd *cptkbd_data = hid_get_drvdata(hdev);
 
 	ret = lenovo_send_cmd_cptkbd(hdev, 0x05, cptkbd_data->fn_lock);
-	ret = lenovo_send_cmd_cptkbd(hdev, 0x02, cptkbd_data->sensitivity);
 	if (ret)
 		hid_err(hdev, "Fn-lock setting failed: %d\n", ret);
+
+	ret = lenovo_send_cmd_cptkbd(hdev, 0x02, cptkbd_data->sensitivity);
+	if (ret)
+		hid_err(hdev, "Sensitivity setting failed: %d\n", ret);
 }
 
 static ssize_t attr_fn_lock_show_cptkbd(struct device *dev,
-- 
1.9.1





More information about the kernel-team mailing list