v9fs/client.c:count should be assigned a value before being used
Summary: move request.count = buflen > fidp->iounit ? fidp->iounit : buflen before request.header.size Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
parent
1fad0f1654
commit
928656f3cb
1 changed files with 1 additions and 1 deletions
|
@ -1098,13 +1098,13 @@ ssize_t v9fs_client_write(FAR struct v9fs_client_s *client, uint32_t fid,
|
||||||
|
|
||||||
while (buflen > 0)
|
while (buflen > 0)
|
||||||
{
|
{
|
||||||
|
request.count = buflen > fidp->iounit ? fidp->iounit : buflen;
|
||||||
request.header.size = V9FS_HDRSZ + V9FS_BIT32SZ + V9FS_BIT64SZ +
|
request.header.size = V9FS_HDRSZ + V9FS_BIT32SZ + V9FS_BIT64SZ +
|
||||||
V9FS_BIT32SZ + request.count;
|
V9FS_BIT32SZ + request.count;
|
||||||
request.header.type = V9FS_TWRITE;
|
request.header.type = V9FS_TWRITE;
|
||||||
request.header.tag = v9fs_get_tagid(client);
|
request.header.tag = v9fs_get_tagid(client);
|
||||||
request.fid = fid;
|
request.fid = fid;
|
||||||
request.offset = offset;
|
request.offset = offset;
|
||||||
request.count = buflen > fidp->iounit ? fidp->iounit : buflen;
|
|
||||||
|
|
||||||
wiov[0].iov_base = &request;
|
wiov[0].iov_base = &request;
|
||||||
wiov[0].iov_len = V9FS_HDRSZ + V9FS_BIT32SZ + V9FS_BIT64SZ +
|
wiov[0].iov_len = V9FS_HDRSZ + V9FS_BIT32SZ + V9FS_BIT64SZ +
|
||||||
|
|
Loading…
Reference in a new issue