diff options
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/comedi_fops.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index d57fadef47fc..2cfb61e0f2b8 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -1142,8 +1142,8 @@ static int do_bufinfo_ioctl(struct comedi_device *dev, return -EACCES; if (bi.bytes_read && !(async->cmd.flags & CMDF_WRITE)) { - bi.bytes_read = comedi_buf_read_alloc(s, bi.bytes_read); - comedi_buf_read_free(s, bi.bytes_read); + comedi_buf_read_alloc(s, bi.bytes_read); + bi.bytes_read = comedi_buf_read_free(s, bi.bytes_read); if (comedi_is_subdevice_idle(s) && comedi_buf_read_n_available(s) == 0) { @@ -1152,9 +1152,8 @@ static int do_bufinfo_ioctl(struct comedi_device *dev, } if (bi.bytes_written && (async->cmd.flags & CMDF_WRITE)) { - bi.bytes_written = - comedi_buf_write_alloc(s, bi.bytes_written); - comedi_buf_write_free(s, bi.bytes_written); + comedi_buf_write_alloc(s, bi.bytes_written); + bi.bytes_written = comedi_buf_write_free(s, bi.bytes_written); } copyback_position: |