Skip to content

Commit

Permalink
iiod-responder: Fix unprotected access to readers list
Browse files Browse the repository at this point in the history
The readers list must be accessed with the iiod_responder's lock held.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
  • Loading branch information
pcercuei committed Jan 31, 2024
1 parent 39d0fb7 commit 0036a9e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions iiod-responder.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,10 @@ int32_t iiod_io_wait_for_response(struct iiod_io *io)
while (!io->r_done) {
ret = iiod_io_cond_wait(io);
if (ret) {
iio_mutex_lock(priv->lock);
__iiod_io_cancel_unlocked(io);
iio_mutex_unlock(priv->lock);

io->r_io.cmd.code = ret;
io->r_done = true;
break;
Expand Down

0 comments on commit 0036a9e

Please sign in to comment.