summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2013-05-10 14:08:28 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-13 17:37:04 -0400
commitb3fab427739c76871c96834e72c369dd0e502d4b (patch)
tree0d16845eb5f9f7029a67934cc03af2e515f31696
parent1581a03573e6c9ebd931e31f9172cce25dcb69e6 (diff)
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>
-rw-r--r--drivers/staging/comedi/comedi_fops.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 00f2547024ec..924c54c9c31f 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -246,9 +246,6 @@ static int resize_async_buffer(struct comedi_device *dev,
return -EBUSY;
}
- if (!async->prealloc_buf)
- return -EINVAL;
-
/* make sure buffer is an integral number of pages
* (we round up) */
new_size = (new_size + PAGE_SIZE - 1) & PAGE_MASK;