diff options
Diffstat (limited to 'drivers/hid/hid-lg3ff.c')
-rw-r--r-- | drivers/hid/hid-lg3ff.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/hid/hid-lg3ff.c b/drivers/hid/hid-lg3ff.c index 9ecb6fd06203..b7e1949f3cf7 100644 --- a/drivers/hid/hid-lg3ff.c +++ b/drivers/hid/hid-lg3ff.c | |||
@@ -117,12 +117,19 @@ static const signed short ff3_joystick_ac[] = { | |||
117 | 117 | ||
118 | int lg3ff_init(struct hid_device *hid) | 118 | int lg3ff_init(struct hid_device *hid) |
119 | { | 119 | { |
120 | struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); | 120 | struct hid_input *hidinput; |
121 | struct input_dev *dev = hidinput->input; | 121 | struct input_dev *dev; |
122 | const signed short *ff_bits = ff3_joystick_ac; | 122 | const signed short *ff_bits = ff3_joystick_ac; |
123 | int error; | 123 | int error; |
124 | int i; | 124 | int i; |
125 | 125 | ||
126 | if (list_empty(&hid->inputs)) { | ||
127 | hid_err(hid, "no inputs found\n"); | ||
128 | return -ENODEV; | ||
129 | } | ||
130 | hidinput = list_entry(hid->inputs.next, struct hid_input, list); | ||
131 | dev = hidinput->input; | ||
132 | |||
126 | /* Check that the report looks ok */ | 133 | /* Check that the report looks ok */ |
127 | if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 35)) | 134 | if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 35)) |
128 | return -ENODEV; | 135 | return -ENODEV; |