]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: allow buffer resize if previous resize failed
authorIan Abbott <abbotti@mev.co.uk>
Fri, 10 May 2013 13:08:28 +0000 (14:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 May 2013 21:37:04 +0000 (17:37 -0400)
commit8f0e30baad7a00748e54191656e619f00fee4731
tree0d16845eb5f9f7029a67934cc03af2e515f31696
parent0ffe97bc770831bf3423fa468d053f5f821468cd
staging: comedi: allow buffer resize if previous resize failed

When a comedi device is successfully attached, those subdevices that
support asynchronous commands will have had buffers allocated
successfully.  It is possible to resize the buffers afterwards, but if
the resize fails the subdevice is left with no buffer
(`s->async->prealloc_buf == NULL`).  Currently, this also causes any
subsequent attempts to resize the buffer to fail with an error, which
seems like a bad idea.

Remove the check in `resize_async_buffer()` that causes the resize to
fail if the subdevice currently has no buffer (presumably due to the
failure of a previous resize attempt).  Callers of
`resize_async_buffer()` have already checked that the subdevice is
allowed to have a buffer.

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