staging: comedi: COMEDI_BUFINFO: return -EPIPE for abnormal read
The `COMEDI_BUFINFO` ioctl is used to advance the current position in
the buffer by a specified amount (which can be 0) and get the current
position. If an asynchronous command in the "read" direction has
stopped normally, the command is terminated as soon as the position has
been advanced to the end of all available data. This is not currently
done if the command terminated with an error. Change it to allow the
command to be terminated even if it stopped with an error, but report an
`EPIPE` error to the user first. The `EPIPE` error will not be
reported until the "read" position reported back to the user has been
advanced to the end of all available data.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>