All of lore.kernel.org
 help / color / mirror / Atom feed
* [djwong-xfs:repair-reap-fixes 17/26] fs/xfs/libxfs/xfs_btree.c:5040 xfs_btree_stage_afakeroot() error: potential null dereference 'nops'. (kmem_alloc returns null)
@ 2020-03-22  3:12 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-03-22  3:12 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git repair-reap-fixes
head:   e55e1901603b56e1850c089a71c5b93c97c2d32f
commit: 62b4fb2c08747bb7fd6d1ccecbfddc5ccc19e450 [17/26] xfs: introduce fake roots for ag-rooted btrees

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

New smatch warnings:
fs/xfs/libxfs/xfs_btree.c:5040 xfs_btree_stage_afakeroot() error: potential null dereference 'nops'.  (kmem_alloc returns null)

Old smatch warnings:
fs/xfs/libxfs/xfs_btree.c:1762 xfs_btree_lookup_get_block() error: we previously assumed 'bp' could be null (see line 1737)

vim +/nops +5040 fs/xfs/libxfs/xfs_btree.c

  5019	
  5020	/*
  5021	 * Initialize a AG-rooted btree cursor with the given AG btree fake root.  The
  5022	 * btree cursor's bc_ops will be overridden as needed to make the staging
  5023	 * functionality work.  If new_ops is not NULL, these new ops will be passed
  5024	 * out to the caller for further overriding.
  5025	 */
  5026	void
  5027	xfs_btree_stage_afakeroot(
  5028		struct xfs_btree_cur		*cur,
  5029		struct xbtree_afakeroot		*afake,
  5030		struct xfs_btree_ops		**new_ops)
  5031	{
  5032		struct xfs_btree_ops		*nops;
  5033	
  5034		ASSERT(!(cur->bc_flags & XFS_BTREE_STAGING));
  5035		ASSERT(!(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE));
  5036		ASSERT(cur->bc_tp == NULL);
  5037	
  5038		nops = kmem_alloc(sizeof(struct xfs_btree_ops), KM_NOFS);
  5039		memcpy(nops, cur->bc_ops, sizeof(struct xfs_btree_ops));
> 5040		nops->alloc_block = xfs_btree_fakeroot_alloc_block;
  5041		nops->free_block = xfs_btree_fakeroot_free_block;
  5042		nops->init_ptr_from_cur = xfs_btree_fakeroot_init_ptr_from_cur;
  5043		nops->set_root = xfs_btree_afakeroot_set_root;
  5044		nops->dup_cursor = xfs_btree_fakeroot_dup_cursor;
  5045	
  5046		cur->bc_private.a.afake = afake;
  5047		cur->bc_nlevels = afake->af_levels;
  5048		cur->bc_ops = nops;
  5049		cur->bc_flags |= XFS_BTREE_STAGING;
  5050	
  5051		if (new_ops)
  5052			*new_ops = nops;
  5053	}
  5054	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-22  3:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-22  3:12 [djwong-xfs:repair-reap-fixes 17/26] fs/xfs/libxfs/xfs_btree.c:5040 xfs_btree_stage_afakeroot() error: potential null dereference 'nops'. (kmem_alloc returns null) kbuild test robot

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.