mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
hidpp10: return EINVAL instead of aborting
While these indicate an obvious error in the caller's code, there is no need to crash the whole program because of this.
This commit is contained in:
@@ -180,7 +180,8 @@ hidpp10_request_command(struct hidpp10_device *dev, union hidpp10_message *msg)
|
||||
command_size = LONG_MESSAGE_LENGTH;
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
hidpp_log_error(&dev->base, "Incorrect message report id: %02x\n", msg->msg.report_id);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* create the expected header */
|
||||
@@ -1943,7 +1944,8 @@ hidpp10_set_led_status(struct hidpp10_device *dev,
|
||||
case HIDPP10_LED_STATUS_SLOW_OFF:
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
hidpp_log_error(&dev->base, "Incorrect LED status: %02x\n", led[i]);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user