mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* fs/xfs/libxfs/xfs_btree_staging.c:144 xfs_btree_stage_afakeroot() error: potential null dereference 'nops'.  (kmem_alloc returns null)
@ 2020-05-29 21:00 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-05-29 21:00 UTC (permalink / raw)
  To: Darrick, J., Wong,; +Cc: kbuild-all, linux-kernel, Brian Foster

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   75caf310d16cc5e2f851c048cd597f5437013368
commit: e06536a692e032470130af5b2136b519595809da xfs: introduce fake roots for ag-rooted btrees
date:   2 months ago
config: i386-randconfig-m021-20200529 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

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

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

vim +/nops +144 fs/xfs/libxfs/xfs_btree_staging.c

   125	
   126	/*
   127	 * Initialize a AG-rooted btree cursor with the given AG btree fake root.
   128	 * The btree cursor's bc_ops will be overridden as needed to make the staging
   129	 * functionality work.
   130	 */
   131	void
   132	xfs_btree_stage_afakeroot(
   133		struct xfs_btree_cur		*cur,
   134		struct xbtree_afakeroot		*afake)
   135	{
   136		struct xfs_btree_ops		*nops;
   137	
   138		ASSERT(!(cur->bc_flags & XFS_BTREE_STAGING));
   139		ASSERT(!(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE));
   140		ASSERT(cur->bc_tp == NULL);
   141	
   142		nops = kmem_alloc(sizeof(struct xfs_btree_ops), KM_NOFS);
   143		memcpy(nops, cur->bc_ops, sizeof(struct xfs_btree_ops));
 > 144		nops->alloc_block = xfs_btree_fakeroot_alloc_block;
   145		nops->free_block = xfs_btree_fakeroot_free_block;
   146		nops->init_ptr_from_cur = xfs_btree_fakeroot_init_ptr_from_cur;
   147		nops->set_root = xfs_btree_afakeroot_set_root;
   148		nops->dup_cursor = xfs_btree_fakeroot_dup_cursor;
   149	
   150		cur->bc_ag.afake = afake;
   151		cur->bc_nlevels = afake->af_levels;
   152		cur->bc_ops = nops;
   153		cur->bc_flags |= XFS_BTREE_STAGING;
   154	}
   155	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38946 bytes --]

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

only message in thread, other threads:[~2020-05-29 21:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 21:00 fs/xfs/libxfs/xfs_btree_staging.c:144 xfs_btree_stage_afakeroot() error: potential null dereference 'nops'. (kmem_alloc returns null) kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®