diff options
| -rw-r--r-- | drivers/hid/hid-logitech-dj.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index ca0ab5112efd..b7ba82960c79 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c | |||
| @@ -238,13 +238,6 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev, | |||
| 238 | return; | 238 | return; |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | if ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) || | ||
| 242 | (dj_report->device_index > DJ_DEVICE_INDEX_MAX)) { | ||
| 243 | dev_err(&djrcv_hdev->dev, "%s: invalid device index:%d\n", | ||
| 244 | __func__, dj_report->device_index); | ||
| 245 | return; | ||
| 246 | } | ||
| 247 | |||
| 248 | if (djrcv_dev->paired_dj_devices[dj_report->device_index]) { | 241 | if (djrcv_dev->paired_dj_devices[dj_report->device_index]) { |
| 249 | /* The device is already known. No need to reallocate it. */ | 242 | /* The device is already known. No need to reallocate it. */ |
| 250 | dbg_hid("%s: device is already known\n", __func__); | 243 | dbg_hid("%s: device is already known\n", __func__); |
| @@ -690,6 +683,12 @@ static int logi_dj_raw_event(struct hid_device *hdev, | |||
| 690 | * device (via hid_input_report() ) and return 1 so hid-core does not do | 683 | * device (via hid_input_report() ) and return 1 so hid-core does not do |
| 691 | * anything else with it. | 684 | * anything else with it. |
| 692 | */ | 685 | */ |
| 686 | if ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) || | ||
| 687 | (dj_report->device_index > DJ_DEVICE_INDEX_MAX)) { | ||
| 688 | dev_err(&hdev->dev, "%s: invalid device index:%d\n", | ||
| 689 | __func__, dj_report->device_index); | ||
| 690 | return false; | ||
| 691 | } | ||
| 693 | 692 | ||
| 694 | spin_lock_irqsave(&djrcv_dev->lock, flags); | 693 | spin_lock_irqsave(&djrcv_dev->lock, flags); |
| 695 | if (dj_report->report_id == REPORT_ID_DJ_SHORT) { | 694 | if (dj_report->report_id == REPORT_ID_DJ_SHORT) { |
