All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [koverstreet-bcachefs:bcachefs-rebalance_v2 518/799] fs/bcachefs/init/chardev.c:249 bch2_ioctl_disk_remove() warn: 'ca' can also be NULL
Date: Mon, 26 Jan 2026 22:49:24 +0800	[thread overview]
Message-ID: <202601262244.pCRcXu7I-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Kent Overstreet <kent.overstreet@linux.dev>

tree:   https://github.com/koverstreet/bcachefs bcachefs-rebalance_v2
head:   d4b3d00447faf8d4d95db47e3902e4ca4db8fbdc
commit: 383cf0dacfb4922419e7d38a3c22766d62fddc05 [518/799] bcachefs: more __free() conversion
:::::: branch date: 3 months ago
:::::: commit date: 3 months ago
config: x86_64-randconfig-r073-20260126 (https://download.01.org/0day-ci/archive/20260126/202601262244.pCRcXu7I-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
smatch version: v0.5.0-8994-gd50c5a4c

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202601262244.pCRcXu7I-lkp@intel.com/

smatch warnings:
fs/bcachefs/init/chardev.c:249 bch2_ioctl_disk_remove() warn: 'ca' can also be NULL

vim +/ca +249 fs/bcachefs/init/chardev.c

ebb0fa27bb872b fs/bcachefs/chardev.c Kent Overstreet       2025-08-18  229  
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  230  static long bch2_ioctl_disk_remove(struct bch_fs *c, struct bch_ioctl_disk arg)
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  231  {
a515d0a50c6e8b fs/bcachefs/chardev.c Tobias Geerinckx-Rice 2021-07-04  232  	if (!capable(CAP_SYS_ADMIN))
a515d0a50c6e8b fs/bcachefs/chardev.c Tobias Geerinckx-Rice 2021-07-04  233  		return -EPERM;
a515d0a50c6e8b fs/bcachefs/chardev.c Tobias Geerinckx-Rice 2021-07-04  234  
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  235  	if ((arg.flags & ~(BCH_FORCE_IF_DATA_LOST|
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  236  			   BCH_FORCE_IF_METADATA_LOST|
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  237  			   BCH_FORCE_IF_DEGRADED|
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  238  			   BCH_BY_INDEX)) ||
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  239  	    arg.pad)
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  240  		return -EINVAL;
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  241  
635c5791582a65 fs/bcachefs/chardev.c Kent Overstreet       2025-07-14  242  	struct bch_dev *ca = bch2_device_lookup(c, arg.dev, arg.flags);
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  243  	if (IS_ERR(ca))
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  244  		return PTR_ERR(ca);
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  245  
c72d1fe6d35296 fs/bcachefs/chardev.c Kent Overstreet       2025-08-18  246  	CLASS(printbuf, err)();
c72d1fe6d35296 fs/bcachefs/chardev.c Kent Overstreet       2025-08-18  247  	int ret = bch2_dev_remove(c, ca, arg.flags, &err);
c72d1fe6d35296 fs/bcachefs/chardev.c Kent Overstreet       2025-08-18  248  	if (ret)
c72d1fe6d35296 fs/bcachefs/chardev.c Kent Overstreet       2025-08-18 @249  		bch_err(ca, "%s", err.buf);
c72d1fe6d35296 fs/bcachefs/chardev.c Kent Overstreet       2025-08-18  250  	return ret;
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  251  }
1c6fdbd8f2465d fs/bcachefs/chardev.c Kent Overstreet       2017-03-16  252  

:::::: The code at line 249 was first introduced by commit
:::::: c72d1fe6d3529612bb93391e29c5658acdf0e568 bcachefs: Plumb a printbuf for error strings through ioctls

:::::: TO: Kent Overstreet <kent.overstreet@linux.dev>
:::::: CC: Kent Overstreet <kent.overstreet@linux.dev>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2026-01-26 14:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-26 14:49 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-05-14 11:21 [koverstreet-bcachefs:bcachefs-rebalance_v2 518/799] fs/bcachefs/init/chardev.c:249 bch2_ioctl_disk_remove() warn: 'ca' can also be NULL kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202601262244.pCRcXu7I-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.