diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c index f80a60539a96..df39868d7e6a 100644 --- a/drivers/hid/hid-roccat-koneplus.c +++ b/drivers/hid/hid-roccat-koneplus.c @@ -523,6 +523,9 @@ static int koneplus_raw_event(struct hid_device *hdev, if (koneplus == NULL) return 0; + if (size < sizeof(struct koneplus_mouse_report_button)) + return 0; + koneplus_keep_values_up_to_date(koneplus, data); if (koneplus->roccat_claimed)