diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-04 06:41:09 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-04 06:41:09 +0100 |
| commit | 16c8373ecf7b3c723a8e765d798ea413bc8345a6 (patch) | |
| tree | 19684614078313ac940ce1ad744772dac71b91a6 /drivers/hid/hid-emsff.c | |
| parent | d19f1d44e74322ae2a75dc07b7d44fecacd5bcfb (diff) | |
| parent | a99d8080aaf358d5d23581244e5da23b35e340b9 (diff) | |
Merge 5.4-rc6 into usb-next
We need the USB fixes in here to build on top of.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hid/hid-emsff.c')
| -rw-r--r-- | drivers/hid/hid-emsff.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/hid/hid-emsff.c b/drivers/hid/hid-emsff.c index 7cd5651872d3..c34f2e5a049f 100644 --- a/drivers/hid/hid-emsff.c +++ b/drivers/hid/hid-emsff.c @@ -47,13 +47,19 @@ static int emsff_init(struct hid_device *hid) { struct emsff_device *emsff; struct hid_report *report; - struct hid_input *hidinput = list_first_entry(&hid->inputs, - struct hid_input, list); + struct hid_input *hidinput; struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; - struct input_dev *dev = hidinput->input; + struct input_dev *dev; int error; + if (list_empty(&hid->inputs)) { + hid_err(hid, "no inputs found\n"); + return -ENODEV; + } + hidinput = list_first_entry(&hid->inputs, struct hid_input, list); + dev = hidinput->input; + if (list_empty(report_list)) { hid_err(hid, "no output reports found\n"); return -ENODEV; |
