From f99a67547629512cc688303d1545e0a2365fedef Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Thu, 10 Sep 2015 18:40:41 -0400 Subject: [PATCH] roccat: check the crc on the profile for the key mapping Signed-off-by: Benjamin Tissoires --- src/driver-roccat.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/driver-roccat.c b/src/driver-roccat.c index 28ff662f..fdf40dda 100644 --- a/src/driver-roccat.c +++ b/src/driver-roccat.c @@ -519,6 +519,11 @@ roccat_read_profile(struct ratbag_profile *profile, unsigned int index) if (rc < ROCCAT_REPORT_SIZE_PROFILE) return; + if (!roccat_crc_is_valid(device, buf, ROCCAT_REPORT_SIZE_PROFILE)) + log_error(device->ratbag, + "Error while reading profile %d, continuing...\n", + profile->index); + log_raw(device->ratbag, "profile: %d %s:%d\n", buf[2], __FILE__, __LINE__);