aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/hid-logitech-dj.c5
-rw-r--r--drivers/hid/hid-logitech-dj.h5
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 5bb6f42a4278..38b12e45780c 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -179,9 +179,6 @@ static const u8 hid_reportid_size_map[NUMBER_OF_HID_REPORTS] = {
179 179
180#define LOGITECH_DJ_INTERFACE_NUMBER 0x02 180#define LOGITECH_DJ_INTERFACE_NUMBER 0x02
181 181
182#define DJ_DEVICE_INDEX_MIN 1
183#define DJ_DEVICE_INDEX_MAX 6
184
185static struct hid_ll_driver logi_dj_ll_driver; 182static struct hid_ll_driver logi_dj_ll_driver;
186 183
187static int logi_dj_output_hidraw_report(struct hid_device *hid, u8 * buf, 184static int logi_dj_output_hidraw_report(struct hid_device *hid, u8 * buf,
@@ -823,7 +820,7 @@ static void logi_dj_remove(struct hid_device *hdev)
823 * have finished and no more raw_event callbacks should arrive after 820 * have finished and no more raw_event callbacks should arrive after
824 * the remove callback was triggered so no locks are put around the 821 * the remove callback was triggered so no locks are put around the
825 * code below */ 822 * code below */
826 for (i = 0; i < DJ_MAX_PAIRED_DEVICES; i++) { 823 for (i = 0; i < (DJ_MAX_PAIRED_DEVICES + DJ_DEVICE_INDEX_MIN); i++) {
827 dj_dev = djrcv_dev->paired_dj_devices[i]; 824 dj_dev = djrcv_dev->paired_dj_devices[i];
828 if (dj_dev != NULL) { 825 if (dj_dev != NULL) {
829 hid_destroy_device(dj_dev->hdev); 826 hid_destroy_device(dj_dev->hdev);
diff --git a/drivers/hid/hid-logitech-dj.h b/drivers/hid/hid-logitech-dj.h
index 5982263acd73..fd28a5e0ca3b 100644
--- a/drivers/hid/hid-logitech-dj.h
+++ b/drivers/hid/hid-logitech-dj.h
@@ -27,6 +27,8 @@
27 27
28#define DJ_MAX_PAIRED_DEVICES 6 28#define DJ_MAX_PAIRED_DEVICES 6
29#define DJ_MAX_NUMBER_NOTIFICATIONS 8 29#define DJ_MAX_NUMBER_NOTIFICATIONS 8
30#define DJ_DEVICE_INDEX_MIN 1
31#define DJ_DEVICE_INDEX_MAX 6
30 32
31#define DJREPORT_SHORT_LENGTH 15 33#define DJREPORT_SHORT_LENGTH 15
32#define DJREPORT_LONG_LENGTH 32 34#define DJREPORT_LONG_LENGTH 32
@@ -94,7 +96,8 @@ struct dj_report {
94 96
95struct dj_receiver_dev { 97struct dj_receiver_dev {
96 struct hid_device *hdev; 98 struct hid_device *hdev;
97 struct dj_device *paired_dj_devices[DJ_MAX_PAIRED_DEVICES]; 99 struct dj_device *paired_dj_devices[DJ_MAX_PAIRED_DEVICES +
100 DJ_DEVICE_INDEX_MIN];
98 struct work_struct work; 101 struct work_struct work;
99 struct kfifo notif_fifo; 102 struct kfifo notif_fifo;
100 spinlock_t lock; 103 spinlock_t lock;