mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 23:09:05 +02:00
vtest: Silence some coverity issues
Add assertion about the returned read/written size being smaller than the size left CID: 1605126, 1604911 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34816>
This commit is contained in:
parent
4fca9d9699
commit
5bec582e30
1 changed files with 2 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ static int virgl_block_write(int fd, void *buf, int size)
|
|||
ret = write(fd, ptr, left);
|
||||
if (ret < 0)
|
||||
return -errno;
|
||||
assert(ret <= left);
|
||||
left -= ret;
|
||||
ptr += ret;
|
||||
} while (left);
|
||||
|
|
@ -66,6 +67,7 @@ static int virgl_block_read(int fd, void *buf, int size)
|
|||
abort();
|
||||
return ret < 0 ? -errno : 0;
|
||||
}
|
||||
assert(ret <= left);
|
||||
left -= ret;
|
||||
ptr += ret;
|
||||
} while (left);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue