|
@@ -587,7 +587,7 @@ static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|
|
struct hiddev_list *list = file->private_data;
|
|
|
struct hiddev *hiddev = list->hiddev;
|
|
|
struct hid_device *hid = hiddev->hid;
|
|
|
- struct usb_device *dev = hid_to_usb_dev(hid);
|
|
|
+ struct usb_device *dev;
|
|
|
struct hiddev_collection_info cinfo;
|
|
|
struct hiddev_report_info rinfo;
|
|
|
struct hiddev_field_info finfo;
|
|
@@ -601,9 +601,11 @@ static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|
|
/* Called without BKL by compat methods so no BKL taken */
|
|
|
|
|
|
/* FIXME: Who or what stop this racing with a disconnect ?? */
|
|
|
- if (!hiddev->exist)
|
|
|
+ if (!hiddev->exist || !hid)
|
|
|
return -EIO;
|
|
|
|
|
|
+ dev = hid_to_usb_dev(hid);
|
|
|
+
|
|
|
switch (cmd) {
|
|
|
|
|
|
case HIDIOCGVERSION:
|