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 <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Link: https://lore.kernel.org/r/202303191227.GL8Dprbi-lkp@intel.com/ Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
1 parent e8d018d commit d7e673c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)