Skip to content

Commit

Permalink
Fix maybe uninitialized variable warning
Browse files Browse the repository at this point in the history
Commit 1c2358c restructured this code and introduced a warning
about the variable maybe not being initialized.  This cannot happen
with the updated code but we should initialize the variable anyway
to silence the warning.

    zpl_file.c: In function ‘zpl_iter_write’:
    zpl_file.c:324:9: warning: ‘count’ may be used uninitialized
        in this function [-Wmaybe-uninitialized]

Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#11373
  • Loading branch information
behlendorf authored and RageLtMan committed May 31, 2021
1 parent 8a8c2d9 commit 70af7b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/os/linux/zfs/zpl_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ zpl_iter_write(struct kiocb *kiocb, struct iov_iter *from)
struct file *filp = kiocb->ki_filp;
struct inode *ip = filp->f_mapping->host;
uio_t uio;
size_t count;
size_t count = 0;
ssize_t ret;

ret = zpl_generic_write_checks(kiocb, from, &count);
Expand Down

0 comments on commit 70af7b6

Please sign in to comment.