G300: fix writing multiple profiles

Writing multiple changed profiles was broken as we would exit the
loop after the first profile write. We were returning the number
of bytes written and this was interpreted as an error.

Fix it my returning 0 when we have written the correct number of
bytes to the mouse.
This commit is contained in:
Thomas Hindoe Paaboel Andersen
2017-09-19 22:42:37 +02:00
committed by Peter Hutterer
parent 3b1a41f154
commit 6d105a002c

View File

@@ -480,7 +480,13 @@ logitech_g300_write_profile(struct ratbag_profile *profile)
HID_FEATURE_REPORT,
HID_REQ_SET_REPORT);
return rc;
if (rc < (signed)sizeof(*report)) {
log_error(device->ratbag,
"Error while writing profile: %d\n", rc);
return rc;
}
return 0;
}
static int