Skip to content

Commit 4fae1b3

Browse files
committed
fs/uio: do not overwrite the return value
Signed-off-by: chao an <[email protected]>
1 parent ff9addc commit 4fae1b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/vfs/fs_uio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ ssize_t uio_calc_resid(FAR const struct uio *uio)
8282
void uio_advance(FAR struct uio *uio, size_t sz)
8383
{
8484
FAR const struct iovec *iov = uio->uio_iov;
85-
int iovcnt = uio->uio_iovcnt;
8685
size_t offset_in_iov = uio->uio_offset_in_iov;
86+
int iovcnt = uio->uio_iovcnt;
8787

8888
DEBUGASSERT(sz <= SSIZE_MAX);
8989
DEBUGASSERT(uio->uio_resid <= SSIZE_MAX);
@@ -131,7 +131,7 @@ int uio_init(FAR struct uio *uio, FAR const struct iovec *iov, int iovcnt)
131131
resid = uio_calc_resid(uio);
132132
if (resid < 0)
133133
{
134-
return -EINVAL;
134+
return resid;
135135
}
136136

137137
uio->uio_resid = resid;

0 commit comments

Comments
 (0)