diff options
| author | David S. Miller <davem@davemloft.net> | 2019-11-02 13:12:51 -0700 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2019-11-02 13:54:56 -0700 |
| commit | d31e95585ca697fb31440c6fe30113adc85ecfbd (patch) | |
| tree | 4936ea0aaa6b2aeeee4db51e3c60d938c9b9ed96 /drivers/hid/hid-axff.c | |
| parent | c23fcbbc6aa4e0bb615e8a7f23e1f32aec235a1c (diff) | |
| parent | 1204c70d9dcba31164f78ad5d8c88c42335d51f8 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
The only slightly tricky merge conflict was the netdevsim because the
mutex locking fix overlapped a lot of driver reload reorganization.
The rest were (relatively) trivial in nature.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/hid/hid-axff.c')
| -rw-r--r-- | drivers/hid/hid-axff.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/hid/hid-axff.c b/drivers/hid/hid-axff.c index 6654c1550e2e..fbe4e16ab029 100644 --- a/drivers/hid/hid-axff.c +++ b/drivers/hid/hid-axff.c @@ -63,13 +63,20 @@ static int axff_init(struct hid_device *hid) { struct axff_device *axff; 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 field_count = 0; int i, j; 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; |