return EINVAL if input NULL (e.g. in case of mod devices)

This commit is contained in:
Ralph Metzler 2017-09-06 17:51:30 +02:00
parent aa2762747f
commit e4acb524a7
1 changed files with 2 additions and 0 deletions

View File

@ -857,6 +857,8 @@ static ssize_t ts_read(struct file *file, __user char *buf,
if (!dev->has_dma)
return -EINVAL;
if (!input)
return -EINVAL;
while (left) {
if (ddb_input_avail(input) < 188) {
if (file->f_flags & O_NONBLOCK)