[jlayton:ceph-netfs-llist 1/10] fs/netfs/buffered_flush.c:923 netfs_require_flush_group() error: uninitialized symbol 'group'.

From: Dan Carpenter
Date: Tue Jul 12 2022 - 05:50:32 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git ceph-netfs-llist
head: fd428464b2220bd6c59f0a30f9dadb4720b3efb5
commit: 3d4ae7bbf12af2c1ee8f93df5d6ea3556bdfb6ca [1/10] netfs: Add a write context
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220709/202207091447.3Om783sk-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

New smatch warnings:
fs/netfs/buffered_flush.c:923 netfs_require_flush_group() error: uninitialized symbol 'group'.

vim +/group +923 fs/netfs/buffered_flush.c

3d4ae7bbf12af2 David Howells 2022-07-07 911 int netfs_require_flush_group(struct netfs_write_context *write, bool force)
ce4670495468b7 David Howells 2022-02-07 912 {
ce4670495468b7 David Howells 2022-02-07 913 struct netfs_flush_group *group;
3d4ae7bbf12af2 David Howells 2022-07-07 914 struct netfs_inode *ctx = write->ctx;
ce4670495468b7 David Howells 2022-02-07 915
ce4670495468b7 David Howells 2022-02-07 916 if (list_empty(&ctx->flush_groups) || force) {
ce4670495468b7 David Howells 2022-02-07 917 kdebug("new flush group");
3d4ae7bbf12af2 David Howells 2022-07-07 918 group = netfs_new_flush_group(ctx, NULL);
ce4670495468b7 David Howells 2022-02-07 919 if (!group)
ce4670495468b7 David Howells 2022-02-07 920 return -ENOMEM;
ce4670495468b7 David Howells 2022-02-07 921 }

"group" not initialized on else path

3d4ae7bbf12af2 David Howells 2022-07-07 922
3d4ae7bbf12af2 David Howells 2022-07-07 @923 write->flush_group = group;
ce4670495468b7 David Howells 2022-02-07 924 return 0;
ce4670495468b7 David Howells 2022-02-07 925 }

--
0-DAY CI Kernel Test Service
https://01.org/lkp