public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Christoph Hellwig <hch@lst.de>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	linux-nvme@lists.infradead.org, Keith Busch <kbusch@kernel.org>,
	Sagi Grimberg <sagi@grimberg.me>, Hannes Reinecke <hare@suse.de>
Subject: [linux-nvme:nvme-5.13 1/9] drivers/nvme/host/multipath.c:815 nvme_mpath_init_identify() warn: missing error code 'error'
Date: Fri, 14 May 2021 08:55:29 +0300	[thread overview]
Message-ID: <202105140250.xTxn7Eqi-lkp@intel.com> (raw)

tree:   git://git.infradead.org/nvme.git nvme-5.13
head:   e181811bd04d874fe48bbfa1165a82068b58144d
commit: 5e1f689913a4498e3081093670ef9d85b2c60920 [1/9] nvme-multipath: fix double initialization of ANA state
config: i386-randconfig-m021-20210513 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

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

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

vim +/error +815 drivers/nvme/host/multipath.c

5e1f689913a449 Christoph Hellwig 2021-04-29  791  int nvme_mpath_init_identify(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
5e1f689913a449 Christoph Hellwig 2021-04-29  792  {
5e1f689913a449 Christoph Hellwig 2021-04-29  793  	size_t max_transfer_size = ctrl->max_hw_sectors << SECTOR_SHIFT;
5e1f689913a449 Christoph Hellwig 2021-04-29  794  	size_t ana_log_size;
5e1f689913a449 Christoph Hellwig 2021-04-29  795  	int error = 0;
0d0b660f214dc4 Christoph Hellwig 2018-05-14  796  
66b20ac0a1a107 Marta Rybczynska  2019-07-23  797  	/* check if multipath is enabled and we have the capability */
92decf118f1da4 Keith Busch       2020-04-03  798  	if (!multipath || !ctrl->subsys ||
92decf118f1da4 Keith Busch       2020-04-03  799  	    !(ctrl->subsys->cmic & NVME_CTRL_CMIC_ANA))
0d0b660f214dc4 Christoph Hellwig 2018-05-14  800  		return 0;
0d0b660f214dc4 Christoph Hellwig 2018-05-14  801  
0d0b660f214dc4 Christoph Hellwig 2018-05-14  802  	ctrl->anacap = id->anacap;
0d0b660f214dc4 Christoph Hellwig 2018-05-14  803  	ctrl->anatt = id->anatt;
0d0b660f214dc4 Christoph Hellwig 2018-05-14  804  	ctrl->nanagrpid = le32_to_cpu(id->nanagrpid);
0d0b660f214dc4 Christoph Hellwig 2018-05-14  805  	ctrl->anagrpmax = le32_to_cpu(id->anagrpmax);
0d0b660f214dc4 Christoph Hellwig 2018-05-14  806  
5e1f689913a449 Christoph Hellwig 2021-04-29  807  	ana_log_size = sizeof(struct nvme_ana_rsp_hdr) +
5e1f689913a449 Christoph Hellwig 2021-04-29  808  		ctrl->nanagrpid * sizeof(struct nvme_ana_group_desc) +
5e1f689913a449 Christoph Hellwig 2021-04-29  809  		ctrl->max_namespaces * sizeof(__le32);
5e1f689913a449 Christoph Hellwig 2021-04-29  810  	if (ana_log_size > max_transfer_size) {
0d0b660f214dc4 Christoph Hellwig 2018-05-14  811  		dev_err(ctrl->device,
5e1f689913a449 Christoph Hellwig 2021-04-29  812  			"ANA log page size (%zd) larger than MDTS (%zd).\n",
5e1f689913a449 Christoph Hellwig 2021-04-29  813  			ana_log_size, max_transfer_size);
0d0b660f214dc4 Christoph Hellwig 2018-05-14  814  		dev_err(ctrl->device, "disabling ANA support.\n");
5e1f689913a449 Christoph Hellwig 2021-04-29 @815  		goto out_uninit;

error = -EINVAL?

0d0b660f214dc4 Christoph Hellwig 2018-05-14  816  	}
5e1f689913a449 Christoph Hellwig 2021-04-29  817  	if (ana_log_size > ctrl->ana_log_size) {
5e1f689913a449 Christoph Hellwig 2021-04-29  818  		nvme_mpath_stop(ctrl);
3b7830904e1720 Logan Gunthorpe   2020-02-20  819  		kfree(ctrl->ana_log_buf);
0d0b660f214dc4 Christoph Hellwig 2018-05-14  820  		ctrl->ana_log_buf = kmalloc(ctrl->ana_log_size, GFP_KERNEL);
5e1f689913a449 Christoph Hellwig 2021-04-29  821  		if (!ctrl->ana_log_buf)
5e1f689913a449 Christoph Hellwig 2021-04-29  822  			return -ENOMEM;
bb830add192e9d Susobhan Dey      2018-09-25  823  	}
5e1f689913a449 Christoph Hellwig 2021-04-29  824  	ctrl->ana_log_size = ana_log_size;
86cccfbf773faf Anton Eidelman    2019-10-18  825  	error = nvme_read_ana_log(ctrl);
0d0b660f214dc4 Christoph Hellwig 2018-05-14  826  	if (error)
5e1f689913a449 Christoph Hellwig 2021-04-29  827  		goto out_uninit;
0d0b660f214dc4 Christoph Hellwig 2018-05-14  828  	return 0;
5e1f689913a449 Christoph Hellwig 2021-04-29  829  
5e1f689913a449 Christoph Hellwig 2021-04-29  830  out_uninit:
5e1f689913a449 Christoph Hellwig 2021-04-29  831  	nvme_mpath_uninit(ctrl);
bb830add192e9d Susobhan Dey      2018-09-25  832  	return error;
0d0b660f214dc4 Christoph Hellwig 2018-05-14  833  }

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


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

                 reply	other threads:[~2021-05-14  5:56 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=202105140250.xTxn7Eqi-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=sagi@grimberg.me \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox