]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: don't allocate buffer space when polling for write
authorIan Abbott <abbotti@mev.co.uk>
Fri, 9 Oct 2015 11:26:50 +0000 (12:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 17:28:40 +0000 (10:28 -0700)
commitab63d3d62b670598af8cb246f43fed34a4a4af95
tree85160cc9d8cd5f8a89f68a31df9612cbb4ddf9dd
parent1312ca7665ec3e5bb04d59b2b7527ae3a028cc0b
staging: comedi: don't allocate buffer space when polling for write

When handling the "poll" file operation and checking for `POLLOUT`,
don't allocate space from the buffer for writing, just check that space
is available for writing.  That check is done after checking that an
asynchronous "write" command is running on the subdevice.  Allocating
the buffer space before checking a "write" command is running can cause
problems if the subdevice supports commands in either direction and
currently has an active "read" command.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi_fops.c