diff options
Diffstat (limited to 'drivers/hid/hid-lg4ff.c')
-rw-r--r-- | drivers/hid/hid-lg4ff.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 03f0220062ca..5e6a0cef2a06 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c | |||
@@ -1253,8 +1253,8 @@ static int lg4ff_handle_multimode_wheel(struct hid_device *hid, u16 *real_produc | |||
1253 | 1253 | ||
1254 | int lg4ff_init(struct hid_device *hid) | 1254 | int lg4ff_init(struct hid_device *hid) |
1255 | { | 1255 | { |
1256 | struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); | 1256 | struct hid_input *hidinput; |
1257 | struct input_dev *dev = hidinput->input; | 1257 | struct input_dev *dev; |
1258 | struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; | 1258 | struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; |
1259 | struct hid_report *report = list_entry(report_list->next, struct hid_report, list); | 1259 | struct hid_report *report = list_entry(report_list->next, struct hid_report, list); |
1260 | const struct usb_device_descriptor *udesc = &(hid_to_usb_dev(hid)->descriptor); | 1260 | const struct usb_device_descriptor *udesc = &(hid_to_usb_dev(hid)->descriptor); |
@@ -1266,6 +1266,13 @@ int lg4ff_init(struct hid_device *hid) | |||
1266 | int mmode_ret, mmode_idx = -1; | 1266 | int mmode_ret, mmode_idx = -1; |
1267 | u16 real_product_id; | 1267 | u16 real_product_id; |
1268 | 1268 | ||
1269 | if (list_empty(&hid->inputs)) { | ||
1270 | hid_err(hid, "no inputs found\n"); | ||
1271 | return -ENODEV; | ||
1272 | } | ||
1273 | hidinput = list_entry(hid->inputs.next, struct hid_input, list); | ||
1274 | dev = hidinput->input; | ||
1275 | |||
1269 | /* Check that the report looks ok */ | 1276 | /* Check that the report looks ok */ |
1270 | if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7)) | 1277 | if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7)) |
1271 | return -1; | 1278 | return -1; |