From 401ba57ccdbb9d32f0a7c4c906e85ea88f41efb8 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Sun, 20 Dec 2020 09:50:13 -0800 Subject: [PATCH] Fix maybe uninitialized variable warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 1c2358c12 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 Closes #11373 --- module/os/linux/zfs/zpl_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/os/linux/zfs/zpl_file.c b/module/os/linux/zfs/zpl_file.c index c8731563f..653fdaf54 100644 --- a/module/os/linux/zfs/zpl_file.c +++ b/module/os/linux/zfs/zpl_file.c @@ -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);