diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2019-11-05 11:00:40 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-11-05 11:00:40 +0100 |
commit | c196924277ea82200d4c4fd9537c71390b96f247 (patch) | |
tree | 2f76c094c3adee9c041e9e89a9431c5c7ef08e85 /drivers/hid/hid-lg3ff.c | |
parent | 6a41b6c5fc20abced88fa0eed42ae5e5cb70b280 (diff) | |
parent | a99d8080aaf358d5d23581244e5da23b35e340b9 (diff) |
Merge tag 'v5.4-rc6' into devel
Linux 5.4-rc6
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[] = { int lg3ff_init(struct hid_device *hid) { - struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); - struct input_dev *dev = hidinput->input; + struct hid_input *hidinput; + struct input_dev *dev; const signed short *ff_bits = ff3_joystick_ac; int error; int i; + if (list_empty(&hid->inputs)) { + hid_err(hid, "no inputs found\n"); + return -ENODEV; + } + hidinput = list_entry(hid->inputs.next, struct hid_input, list); + dev = hidinput->input; + /* Check that the report looks ok */ if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 35)) return -ENODEV; |