diff options
Diffstat (limited to 'drivers/hid/hid-dr.c')
-rw-r--r-- | drivers/hid/hid-dr.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/hid/hid-dr.c b/drivers/hid/hid-dr.c index 17e17f9a597b..947f19f8685f 100644 --- a/drivers/hid/hid-dr.c +++ b/drivers/hid/hid-dr.c | |||
@@ -75,13 +75,19 @@ static int drff_init(struct hid_device *hid) | |||
75 | { | 75 | { |
76 | struct drff_device *drff; | 76 | struct drff_device *drff; |
77 | struct hid_report *report; | 77 | struct hid_report *report; |
78 | struct hid_input *hidinput = list_first_entry(&hid->inputs, | 78 | struct hid_input *hidinput; |
79 | struct hid_input, list); | ||
80 | struct list_head *report_list = | 79 | struct list_head *report_list = |
81 | &hid->report_enum[HID_OUTPUT_REPORT].report_list; | 80 | &hid->report_enum[HID_OUTPUT_REPORT].report_list; |
82 | struct input_dev *dev = hidinput->input; | 81 | struct input_dev *dev; |
83 | int error; | 82 | int error; |
84 | 83 | ||
84 | if (list_empty(&hid->inputs)) { | ||
85 | hid_err(hid, "no inputs found\n"); | ||
86 | return -ENODEV; | ||
87 | } | ||
88 | hidinput = list_first_entry(&hid->inputs, struct hid_input, list); | ||
89 | dev = hidinput->input; | ||
90 | |||
85 | if (list_empty(report_list)) { | 91 | if (list_empty(report_list)) { |
86 | hid_err(hid, "no output reports found\n"); | 92 | hid_err(hid, "no output reports found\n"); |
87 | return -ENODEV; | 93 | return -ENODEV; |