From c633edc773aaff08a6bbd1e2b14b4b10a683813a Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 7 Jul 2017 13:41:49 +0100 Subject: [PATCH] unifying: Don't log a warning when an unknown report is parsed Fixes: https://github.com/hughsie/fwupd/issues/151 --- plugins/unifying/lu-device.c | 7 +++++++ plugins/unifying/lu-hidpp-msg.c | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/unifying/lu-device.c b/plugins/unifying/lu-device.c index 072b29f34..85a2cccb7 100644 --- a/plugins/unifying/lu-device.c +++ b/plugins/unifying/lu-device.c @@ -498,6 +498,13 @@ lu_device_hidpp_transfer (LuDevice *device, LuHidppMsg *msg, GError **error) if (!lu_device_hidpp_receive (device, msg_tmp, timeout, error)) return FALSE; + /* we don't know how to handle this report packet */ + if (lu_hidpp_msg_get_payload_length (msg_tmp) == 0x0) { + g_debug ("HID++1.0 report 0x%02x has unknown length, ignoring", + msg_tmp->report_id); + continue; + } + if (!lu_hidpp_msg_is_error (msg_tmp, error)) return FALSE; diff --git a/plugins/unifying/lu-hidpp-msg.c b/plugins/unifying/lu-hidpp-msg.c index 6c620f882..6dde1a3d4 100644 --- a/plugins/unifying/lu-hidpp-msg.c +++ b/plugins/unifying/lu-hidpp-msg.c @@ -70,8 +70,7 @@ lu_hidpp_msg_get_payload_length (LuHidppMsg *msg) return 0x2f; if (msg->report_id == HIDPP_REPORT_NOTIFICATION) return 0x08; - g_warning ("report 0x%02x unknown length", msg->report_id); - return 0x08; + return 0x0; } const gchar *