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: [android-common:android13-5.15 8/8] drivers/nvme/host/multipath.c:332 nvme_ns_head_submit_bio() warn: variable dereferenced before check 'bio' (see line 320)
Date: Tue, 20 Oct 2026 01:30:31 +0200	[thread overview]
Message-ID: <202610200148.xdHHqCtw-lkp@intel.com> (raw)

Unfiltered warning: this smatch report is sent as-is and has not been
reviewed for false positives, so please treat it with due skepticism.

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: cros-kernel-buildreports@googlegroups.com

tree:   https://android.googlesource.com/kernel/common android13-5.15
head:   0bb006856b8d8b803fde48d026d89a5fafcd5263
commit: 7ec9a45fc4ee7fc1054c2cabf8b09a6bc708472e [8/8] block: handle bio_split_to_limits() NULL return
:::::: branch date: 8 hours ago
:::::: commit date: 3 years, 9 months ago
config: arm-randconfig-r2200-20261019 (https://download.01.org/0day-ci/archive/20261020/202610200148.xdHHqCtw-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.5.0
smatch: v0.5.0-9187-g5189e3fb

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/202610200148.xdHHqCtw-lkp@intel.com/

New smatch warnings:
drivers/nvme/host/multipath.c:332 nvme_ns_head_submit_bio() warn: variable dereferenced before check 'bio' (see line 320)

Old smatch warnings:
drivers/nvme/host/multipath.c:869 nvme_mpath_init_identify() warn: missing error code 'error'

vim +/bio +332 drivers/nvme/host/multipath.c

0157ec8dad3c8fc Sagi Grimberg     2019-07-25  317  
1496bd4936d215f Christoph Hellwig 2021-04-07  318  static blk_qc_t nvme_ns_head_submit_bio(struct bio *bio)
32acab3181c7053 Christoph Hellwig 2017-11-02  319  {
309dca309fc39a9 Christoph Hellwig 2021-01-24 @320  	struct nvme_ns_head *head = bio->bi_bdev->bd_disk->private_data;
32acab3181c7053 Christoph Hellwig 2017-11-02  321  	struct device *dev = disk_to_dev(head->disk);
32acab3181c7053 Christoph Hellwig 2017-11-02  322  	struct nvme_ns *ns;
32acab3181c7053 Christoph Hellwig 2017-11-02  323  	blk_qc_t ret = BLK_QC_T_NONE;
32acab3181c7053 Christoph Hellwig 2017-11-02  324  	int srcu_idx;
32acab3181c7053 Christoph Hellwig 2017-11-02  325  
525aa5a705d86e1 Hannes Reinecke   2019-04-30  326  	/*
f695ca3886ce72b Christoph Hellwig 2020-07-01  327  	 * The namespace might be going away and the bio might be moved to a
f695ca3886ce72b Christoph Hellwig 2020-07-01  328  	 * different queue via blk_steal_bios(), so we need to use the bio_split
f695ca3886ce72b Christoph Hellwig 2020-07-01  329  	 * pool from the original queue to allocate the bvecs from.
525aa5a705d86e1 Hannes Reinecke   2019-04-30  330  	 */
f695ca3886ce72b Christoph Hellwig 2020-07-01  331  	blk_queue_split(&bio);
7ec9a45fc4ee7fc Jens Axboe        2023-01-04 @332  	if (!bio)
7ec9a45fc4ee7fc Jens Axboe        2023-01-04  333  		return BLK_QC_T_NONE;
525aa5a705d86e1 Hannes Reinecke   2019-04-30  334  
32acab3181c7053 Christoph Hellwig 2017-11-02  335  	srcu_idx = srcu_read_lock(&head->srcu);
32acab3181c7053 Christoph Hellwig 2017-11-02  336  	ns = nvme_find_path(head);
32acab3181c7053 Christoph Hellwig 2017-11-02  337  	if (likely(ns)) {
a7c7f7b2b641bef Christoph Hellwig 2021-01-26  338  		bio_set_dev(bio, ns->disk->part0);
32acab3181c7053 Christoph Hellwig 2017-11-02  339  		bio->bi_opf |= REQ_NVME_MPATH;
1c02fca620f7273 Christoph Hellwig 2020-12-03  340  		trace_block_bio_remap(bio, disk_devt(ns->head->disk),
2796b569591c6f0 Hannes Reinecke   2018-06-07  341  				      bio->bi_iter.bi_sector);
5a6c35f9af41611 Christoph Hellwig 2020-07-01  342  		ret = submit_bio_noacct(bio);
0157ec8dad3c8fc Sagi Grimberg     2019-07-25  343  	} else if (nvme_available_path(head)) {
0157ec8dad3c8fc Sagi Grimberg     2019-07-25  344  		dev_warn_ratelimited(dev, "no usable path - requeuing I/O\n");
32acab3181c7053 Christoph Hellwig 2017-11-02  345  
32acab3181c7053 Christoph Hellwig 2017-11-02  346  		spin_lock_irq(&head->requeue_lock);
32acab3181c7053 Christoph Hellwig 2017-11-02  347  		bio_list_add(&head->requeue_list, bio);
32acab3181c7053 Christoph Hellwig 2017-11-02  348  		spin_unlock_irq(&head->requeue_lock);
32acab3181c7053 Christoph Hellwig 2017-11-02  349  	} else {
0157ec8dad3c8fc Sagi Grimberg     2019-07-25  350  		dev_warn_ratelimited(dev, "no available path - failing I/O\n");
32acab3181c7053 Christoph Hellwig 2017-11-02  351  
32acab3181c7053 Christoph Hellwig 2017-11-02  352  		bio->bi_status = BLK_STS_IOERR;
32acab3181c7053 Christoph Hellwig 2017-11-02  353  		bio_endio(bio);
32acab3181c7053 Christoph Hellwig 2017-11-02  354  	}
32acab3181c7053 Christoph Hellwig 2017-11-02  355  
32acab3181c7053 Christoph Hellwig 2017-11-02  356  	srcu_read_unlock(&head->srcu, srcu_idx);
32acab3181c7053 Christoph Hellwig 2017-11-02  357  	return ret;
32acab3181c7053 Christoph Hellwig 2017-11-02  358  }
32acab3181c7053 Christoph Hellwig 2017-11-02  359  

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

                 reply	other threads:[~2026-10-19 23:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202610200148.xdHHqCtw-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.