aboutsummaryrefslogtreecommitdiff
path: root/drivers/hid/hidraw.c
diff options
context:
space:
mode:
authorGravatar Takashi Iwai <tiwai@suse.de> 2018-04-25 10:41:08 +0200
committerGravatar Takashi Iwai <tiwai@suse.de> 2018-04-25 16:44:36 +0200
commit4d31c6e41ed2f95f97a19766812797dabd82a5ee (patch)
treee1f81f4f0108ff86f85b8e17b025b21609aec7b2 /drivers/hid/hidraw.c
parentALSA: hda - Sanity check of access to SPDIF controls array (diff)
parentALSA: hda - Skip jack and others for non-existing PCM streams (diff)
downloadlinux-4d31c6e41ed2f95f97a19766812797dabd82a5ee.tar.gz
linux-4d31c6e41ed2f95f97a19766812797dabd82a5ee.tar.bz2
linux-4d31c6e41ed2f95f97a19766812797dabd82a5ee.zip
Merge branch 'for-linus' into for-next
Back-merge 4.17-rc3 fixes for further development. This will bump the base to 4.17-rc2, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'drivers/hid/hidraw.c')
-rw-r--r--drivers/hid/hidraw.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index fbfcc8009432..b39844adea47 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -192,6 +192,11 @@ static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t
int ret = 0, len;
unsigned char report_number;
+ if (!hidraw_table[minor] || !hidraw_table[minor]->exist) {
+ ret = -ENODEV;
+ goto out;
+ }
+
dev = hidraw_table[minor]->hid;
if (!dev->ll_driver->raw_request) {