]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
staging: comedi: COMEDI_BUFINFO: return error if no active command
authorIan Abbott <abbotti@mev.co.uk>
Fri, 19 Feb 2016 16:13:54 +0000 (16:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 23:25:58 +0000 (15:25 -0800)
commit57c563bf78f50d8a43e7ffe0087bc43dc0f188aa
tree20ccee91a3ad65d1042702fb23d18733cc02203f
parentbb0c6bfac7d4aebb6525b285ca03c4316d72647a
staging: comedi: COMEDI_BUFINFO: return error if no active command

The `COMEDI_BUFINFO` ioctl is used to advance the current position in
the buffer and/or get the current buffer position.  If no asynchronous
command is active (started via the file object that issued this ioctl),
this information is meaningless.  Change it to return an error
(`-EINVAL`) in this case.  Prior to this change, if a command was
started via a different file object, the ioctl returned `-EACCES`, but
now it will return `-EINVAL`, which is consistent with the current
behavior of the "read" and "write" file operation handlers.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi_fops.c