Skip to content

Commit

Permalink
fs/uio: do not overwrite the return value
Browse files Browse the repository at this point in the history
Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Jan 21, 2025
1 parent ff9addc commit 4fae1b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/vfs/fs_uio.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ ssize_t uio_calc_resid(FAR const struct uio *uio)
void uio_advance(FAR struct uio *uio, size_t sz)
{
FAR const struct iovec *iov = uio->uio_iov;
int iovcnt = uio->uio_iovcnt;
size_t offset_in_iov = uio->uio_offset_in_iov;
int iovcnt = uio->uio_iovcnt;

DEBUGASSERT(sz <= SSIZE_MAX);
DEBUGASSERT(uio->uio_resid <= SSIZE_MAX);
Expand Down Expand Up @@ -131,7 +131,7 @@ int uio_init(FAR struct uio *uio, FAR const struct iovec *iov, int iovcnt)
resid = uio_calc_resid(uio);
if (resid < 0)
{
return -EINVAL;
return resid;
}

uio->uio_resid = resid;
Expand Down

0 comments on commit 4fae1b3

Please sign in to comment.