]> 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)
commit278d5fbcf0c78eae9184d39434da418697e858f3
tree85160cc9d8cd5f8a89f68a31df9612cbb4ddf9dd
parent99c56a6f9c8f22308f54f752dff76ceebdc49979
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