All of lore.kernel.org
 help / color / mirror / Atom feed
* [rhvgoyal:virtiofs-dax-5.5 13/27] fs/fuse/file.c:340 dmap_removemapping_list() error: uninitialized symbol 'ret'.
@ 2020-01-10  5:42 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2020-01-10  5:42 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3439 bytes --]

tree:   https://github.com/rhvgoyal/linux virtiofs-dax-5.5
head:   1e5ce59e58194ee5ad14fa26fb617a2c54ab8bf1
commit: 294ba78007c7bdd196f37c85a82e57eecc1918ae [13/27] fuse, dax: Implement dax read/write operations

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
fs/fuse/file.c:340 dmap_removemapping_list() error: uninitialized symbol 'ret'.

# https://github.com/rhvgoyal/linux/commit/294ba78007c7bdd196f37c85a82e57eecc1918ae
git remote add rhvgoyal https://github.com/rhvgoyal/linux
git remote update rhvgoyal
git checkout 294ba78007c7bdd196f37c85a82e57eecc1918ae
vim +/ret +340 fs/fuse/file.c

294ba78007c7bd Vivek Goyal 2018-11-19  307  static int dmap_removemapping_list(struct inode *inode, unsigned num,
294ba78007c7bd Vivek Goyal 2018-11-19  308  				   struct list_head *to_remove)
294ba78007c7bd Vivek Goyal 2018-11-19  309  {
294ba78007c7bd Vivek Goyal 2018-11-19  310  	struct fuse_removemapping_one *remove_one, *ptr;
294ba78007c7bd Vivek Goyal 2018-11-19  311  	struct fuse_removemapping_in inarg;
294ba78007c7bd Vivek Goyal 2018-11-19  312  	struct fuse_dax_mapping *dmap;
294ba78007c7bd Vivek Goyal 2018-11-19  313  	int ret, i = 0, nr_alloc;
294ba78007c7bd Vivek Goyal 2018-11-19  314  
294ba78007c7bd Vivek Goyal 2018-11-19  315  	nr_alloc = min_t(unsigned int, num, FUSE_REMOVEMAPPING_MAX_ENTRY);
294ba78007c7bd Vivek Goyal 2018-11-19  316  	remove_one = kmalloc_array(nr_alloc, sizeof(*remove_one), GFP_NOFS);
294ba78007c7bd Vivek Goyal 2018-11-19  317  	if (!remove_one)
294ba78007c7bd Vivek Goyal 2018-11-19  318  		return -ENOMEM;
294ba78007c7bd Vivek Goyal 2018-11-19  319  
294ba78007c7bd Vivek Goyal 2018-11-19  320  	ptr = remove_one;
294ba78007c7bd Vivek Goyal 2018-11-19  321  	list_for_each_entry(dmap, to_remove, list) {
                                                                          ^^^^^^^^^
Can this list be empty?

294ba78007c7bd Vivek Goyal 2018-11-19  322  		ptr->moffset = dmap->window_offset;
294ba78007c7bd Vivek Goyal 2018-11-19  323  		ptr->len = dmap->length;
294ba78007c7bd Vivek Goyal 2018-11-19  324  		ptr++;
294ba78007c7bd Vivek Goyal 2018-11-19  325  		i++;
294ba78007c7bd Vivek Goyal 2018-11-19  326  		num--;
294ba78007c7bd Vivek Goyal 2018-11-19  327  		if (i >= nr_alloc || num == 0) {
294ba78007c7bd Vivek Goyal 2018-11-19  328  			memset(&inarg, 0, sizeof(inarg));
294ba78007c7bd Vivek Goyal 2018-11-19  329  			inarg.count = i;
294ba78007c7bd Vivek Goyal 2018-11-19  330  			ret = fuse_send_removemapping(inode, &inarg,
294ba78007c7bd Vivek Goyal 2018-11-19  331  						      remove_one);
294ba78007c7bd Vivek Goyal 2018-11-19  332  			if (ret)
294ba78007c7bd Vivek Goyal 2018-11-19  333  				goto out;
294ba78007c7bd Vivek Goyal 2018-11-19  334  			ptr = remove_one;
294ba78007c7bd Vivek Goyal 2018-11-19  335  			i = 0;
294ba78007c7bd Vivek Goyal 2018-11-19  336  		}
294ba78007c7bd Vivek Goyal 2018-11-19  337  	}
294ba78007c7bd Vivek Goyal 2018-11-19  338  out:
294ba78007c7bd Vivek Goyal 2018-11-19  339  	kfree(remove_one);
294ba78007c7bd Vivek Goyal 2018-11-19 @340  	return ret;
294ba78007c7bd Vivek Goyal 2018-11-19  341  }

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [rhvgoyal:virtiofs-dax-5.5 13/27] fs/fuse/file.c:340 dmap_removemapping_list() error: uninitialized symbol 'ret'.
@ 2020-01-10  5:42 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2020-01-10  5:42 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3439 bytes --]

tree:   https://github.com/rhvgoyal/linux virtiofs-dax-5.5
head:   1e5ce59e58194ee5ad14fa26fb617a2c54ab8bf1
commit: 294ba78007c7bdd196f37c85a82e57eecc1918ae [13/27] fuse, dax: Implement dax read/write operations

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
fs/fuse/file.c:340 dmap_removemapping_list() error: uninitialized symbol 'ret'.

# https://github.com/rhvgoyal/linux/commit/294ba78007c7bdd196f37c85a82e57eecc1918ae
git remote add rhvgoyal https://github.com/rhvgoyal/linux
git remote update rhvgoyal
git checkout 294ba78007c7bdd196f37c85a82e57eecc1918ae
vim +/ret +340 fs/fuse/file.c

294ba78007c7bd Vivek Goyal 2018-11-19  307  static int dmap_removemapping_list(struct inode *inode, unsigned num,
294ba78007c7bd Vivek Goyal 2018-11-19  308  				   struct list_head *to_remove)
294ba78007c7bd Vivek Goyal 2018-11-19  309  {
294ba78007c7bd Vivek Goyal 2018-11-19  310  	struct fuse_removemapping_one *remove_one, *ptr;
294ba78007c7bd Vivek Goyal 2018-11-19  311  	struct fuse_removemapping_in inarg;
294ba78007c7bd Vivek Goyal 2018-11-19  312  	struct fuse_dax_mapping *dmap;
294ba78007c7bd Vivek Goyal 2018-11-19  313  	int ret, i = 0, nr_alloc;
294ba78007c7bd Vivek Goyal 2018-11-19  314  
294ba78007c7bd Vivek Goyal 2018-11-19  315  	nr_alloc = min_t(unsigned int, num, FUSE_REMOVEMAPPING_MAX_ENTRY);
294ba78007c7bd Vivek Goyal 2018-11-19  316  	remove_one = kmalloc_array(nr_alloc, sizeof(*remove_one), GFP_NOFS);
294ba78007c7bd Vivek Goyal 2018-11-19  317  	if (!remove_one)
294ba78007c7bd Vivek Goyal 2018-11-19  318  		return -ENOMEM;
294ba78007c7bd Vivek Goyal 2018-11-19  319  
294ba78007c7bd Vivek Goyal 2018-11-19  320  	ptr = remove_one;
294ba78007c7bd Vivek Goyal 2018-11-19  321  	list_for_each_entry(dmap, to_remove, list) {
                                                                          ^^^^^^^^^
Can this list be empty?

294ba78007c7bd Vivek Goyal 2018-11-19  322  		ptr->moffset = dmap->window_offset;
294ba78007c7bd Vivek Goyal 2018-11-19  323  		ptr->len = dmap->length;
294ba78007c7bd Vivek Goyal 2018-11-19  324  		ptr++;
294ba78007c7bd Vivek Goyal 2018-11-19  325  		i++;
294ba78007c7bd Vivek Goyal 2018-11-19  326  		num--;
294ba78007c7bd Vivek Goyal 2018-11-19  327  		if (i >= nr_alloc || num == 0) {
294ba78007c7bd Vivek Goyal 2018-11-19  328  			memset(&inarg, 0, sizeof(inarg));
294ba78007c7bd Vivek Goyal 2018-11-19  329  			inarg.count = i;
294ba78007c7bd Vivek Goyal 2018-11-19  330  			ret = fuse_send_removemapping(inode, &inarg,
294ba78007c7bd Vivek Goyal 2018-11-19  331  						      remove_one);
294ba78007c7bd Vivek Goyal 2018-11-19  332  			if (ret)
294ba78007c7bd Vivek Goyal 2018-11-19  333  				goto out;
294ba78007c7bd Vivek Goyal 2018-11-19  334  			ptr = remove_one;
294ba78007c7bd Vivek Goyal 2018-11-19  335  			i = 0;
294ba78007c7bd Vivek Goyal 2018-11-19  336  		}
294ba78007c7bd Vivek Goyal 2018-11-19  337  	}
294ba78007c7bd Vivek Goyal 2018-11-19  338  out:
294ba78007c7bd Vivek Goyal 2018-11-19  339  	kfree(remove_one);
294ba78007c7bd Vivek Goyal 2018-11-19 @340  	return ret;
294ba78007c7bd Vivek Goyal 2018-11-19  341  }

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-10  5:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-10  5:42 [rhvgoyal:virtiofs-dax-5.5 13/27] fs/fuse/file.c:340 dmap_removemapping_list() error: uninitialized symbol 'ret' Dan Carpenter
2020-01-10  5:42 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.