Skip to content

Commit

Permalink
local: Don't check size of dequeued buffer vs. bytes_used
Browse files Browse the repository at this point in the history
We already make sure in the high-level API (buffer.c) that bytes_used
will always be smaller or equal than the buffer size.

Therefore, the case where bytes_used is bigger than a newly dequeued
block will never happen.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
  • Loading branch information
pcercuei committed Nov 16, 2021
1 parent 0e1a938 commit cbe8ba5
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions local.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,6 @@ static ssize_t local_get_buffer(const struct iio_device *dev,
return ret;
}

/* Requested buffer size is too big! */
if (pdata->last_dequeued < 0 && bytes_used > block.size)
return -EFBIG;

pdata->last_dequeued = block.id;
*addr_ptr = pdata->addrs[block.id];
return (ssize_t) block.bytes_used;
Expand Down

0 comments on commit cbe8ba5

Please sign in to comment.