Skip to content

Commit

Permalink
iiod/responder: Initialize code before sending
Browse files Browse the repository at this point in the history
If iio_context_get_device() does not return a iio_device pointer then
the uninitialized ret variable was passed as a code to
iiod_io_send_response_code().

Signed-off-by: Philip Molloy <[email protected]>
  • Loading branch information
pamolloy authored and dNechita committed Feb 11, 2025
1 parent a80a312 commit e06b175
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iiod/responder.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ static void handle_free_buffer(struct parser_pdata *pdata,
struct block_entry *block_entry, *block_next;
struct buffer_entry *entry, *buf_entry;
struct iio_buffer *buf;
int ret;
int ret = -ENODEV;

dev = iio_context_get_device(pdata->ctx, cmd->dev);
if (!dev)
Expand Down

0 comments on commit e06b175

Please sign in to comment.