Skip to content

Commit d7e673c

Browse files
author
Damien Le Moal
committed
zonefs: Prevent uninitialized symbol 'size' warning
In zonefs_file_dio_append(), initialize the variable size to 0 to prevent compilation and static code analizers warning such as: New smatch warnings: fs/zonefs/file.c:441 zonefs_file_dio_append() error: uninitialized symbol 'size'. The warning is a false positive as size is never actually used uninitialized. No functional change. Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]>
1 parent e8d018d commit d7e673c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/zonefs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
383383
struct block_device *bdev = inode->i_sb->s_bdev;
384384
unsigned int max = bdev_max_zone_append_sectors(bdev);
385385
struct bio *bio;
386-
ssize_t size;
386+
ssize_t size = 0;
387387
int nr_pages;
388388
ssize_t ret;
389389

0 commit comments

Comments
 (0)