1
0
forked from drath/libratbag

gskill: Update checksum *after* updating profile name

Noticed this while adding support for profile commits. This is definitely
a bug.

Signed-off-by: Lyude <thatslyude@gmail.com>
This commit is contained in:
Lyude
2016-10-11 12:39:57 -04:00
committed by bentiss
parent e543723856
commit 3aabba255d

View File

@@ -571,8 +571,6 @@ gskill_do_write_profile(struct ratbag_device *device,
uint8_t *buf = (uint8_t*)report;
int rc;
report->checksum = gskill_calculate_checksum(buf, sizeof(*report));
/*
* The G.Skill configuration software doesn't take kindly to blank
* profile names, so ensure we have one
@@ -589,6 +587,8 @@ gskill_do_write_profile(struct ratbag_device *device,
return rc;
}
report->checksum = gskill_calculate_checksum(buf, sizeof(*report));
rc = gskill_select_profile(device, report->profile_num, true);
if (rc)
return rc;