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)
commitecf04ed34d65b735bbdfa9ae8ea378ffc0faa9f6
tree85160cc9d8cd5f8a89f68a31df9612cbb4ddf9dd
parent432fbde739583140c7ee937910786a9d740804c9
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