mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
sinowealth: return an error code instead of doing an assert
While I doubt it will actually ever get hit, there is no reason to crash the whole daemon because of this.
This commit is contained in:
committed by
Ilya guterman
parent
0608a0156d
commit
e7cc62a9c8
@@ -524,7 +524,10 @@ sinowealth_get_active_profile(struct ratbag_device *device)
|
||||
static int
|
||||
sinowealth_set_active_profile(struct ratbag_device *device, unsigned int index)
|
||||
{
|
||||
assert(index <= SINOWEALTH_NUM_PROFILES - 1);
|
||||
if (index >= SINOWEALTH_NUM_PROFILES) {
|
||||
log_error(device->ratbag, "Profile index %u is out of range", index);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
int rc = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user