Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, "Liu Peibao" <liupeibao@loongson.cn>,
	"Bjorn Helgaas" <helgaas@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	chenhuacai@loongson.cn, lvjianmin@loongson.cn,
	zhuyinbo@loongson.cn, liupeibao@loongson.cn,
	linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] PCI: loongson: add skip-scan property for child DT node
Date: Thu, 17 Nov 2022 07:12:24 +0300	[thread overview]
Message-ID: <202211160131.oycRMuJQ-lkp@intel.com> (raw)
In-Reply-To: <20221103090040.836-1-liupeibao@loongson.cn>

Hi Liu,

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Liu-Peibao/PCI-loongson-add-skip-scan-property-for-child-DT-node/20221103-170125
base:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
patch link:    https://lore.kernel.org/r/20221103090040.836-1-liupeibao%40loongson.cn
patch subject: [PATCH 1/2] PCI: loongson: add skip-scan property for child DT node
config: loongarch-randconfig-m041-20221114
compiler: loongarch64-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>

smatch warnings:
drivers/pci/controller/pci-loongson.c:257 setup_masklist() error: not allocating enough for = 'entry' 24 vs 8

vim +/entry +257 drivers/pci/controller/pci-loongson.c

f93e71fb8e65ba Liu Peibao  2022-11-03  242  static int setup_masklist(struct loongson_pci *priv)
f93e71fb8e65ba Liu Peibao  2022-11-03  243  {
f93e71fb8e65ba Liu Peibao  2022-11-03  244  	struct device *dev = &priv->pdev->dev;
f93e71fb8e65ba Liu Peibao  2022-11-03  245  	struct device_node *dn, *parent = dev->of_node;
f93e71fb8e65ba Liu Peibao  2022-11-03  246  	struct mask_entry *entry;
f93e71fb8e65ba Liu Peibao  2022-11-03  247  	int devfn;
f93e71fb8e65ba Liu Peibao  2022-11-03  248  
f93e71fb8e65ba Liu Peibao  2022-11-03  249  	INIT_LIST_HEAD(&priv->masklist);
f93e71fb8e65ba Liu Peibao  2022-11-03  250  
f93e71fb8e65ba Liu Peibao  2022-11-03  251  	for_each_child_of_node(parent, dn) {
f93e71fb8e65ba Liu Peibao  2022-11-03  252  		if (of_property_read_bool(dn, "skip-scan")) {
f93e71fb8e65ba Liu Peibao  2022-11-03  253  			devfn = of_pci_get_devfn(dn);
f93e71fb8e65ba Liu Peibao  2022-11-03  254  			if (devfn < 0)
f93e71fb8e65ba Liu Peibao  2022-11-03  255  				continue;
f93e71fb8e65ba Liu Peibao  2022-11-03  256  
f93e71fb8e65ba Liu Peibao  2022-11-03 @257  			entry = devm_kzalloc(dev, sizeof(entry), GFP_KERNEL);
                                                                                          ^^^^^^^^^^^^^
Should be sizeof(*entry)

f93e71fb8e65ba Liu Peibao  2022-11-03  258  			if (!entry)
f93e71fb8e65ba Liu Peibao  2022-11-03  259  				return -ENOMEM;
f93e71fb8e65ba Liu Peibao  2022-11-03  260  
f93e71fb8e65ba Liu Peibao  2022-11-03  261  			entry->devfn = devfn;
f93e71fb8e65ba Liu Peibao  2022-11-03  262  			list_add_tail(&entry->entry, &priv->masklist);
f93e71fb8e65ba Liu Peibao  2022-11-03  263  		}
f93e71fb8e65ba Liu Peibao  2022-11-03  264  	}
f93e71fb8e65ba Liu Peibao  2022-11-03  265  
f93e71fb8e65ba Liu Peibao  2022-11-03  266  	return 0;
f93e71fb8e65ba Liu Peibao  2022-11-03  267  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


      parent reply	other threads:[~2022-11-17  4:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03  9:00 [PATCH 1/2] PCI: loongson: add skip-scan property for child DT node Liu Peibao
2022-11-03  9:00 ` [PATCH 2/2] dt-bindings: PCI: loongson: Add skip-scan property for child node Liu Peibao
2022-11-03 21:53   ` Krzysztof Kozlowski
2022-11-04  6:42     ` Liu Peibao
2022-11-03 11:37 ` [PATCH 1/2] PCI: loongson: add skip-scan property for child DT node Jiaxun Yang
2022-11-04  6:36   ` Liu Peibao
2022-11-17  4:12 ` Dan Carpenter [this message]

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=202211160131.oycRMuJQ-lkp@intel.com \
    --to=error27@gmail.com \
    --cc=chenhuacai@loongson.cn \
    --cc=devicetree@vger.kernel.org \
    --cc=helgaas@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=krzk@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=liupeibao@loongson.cn \
    --cc=lkp@intel.com \
    --cc=lpieralisi@kernel.org \
    --cc=lvjianmin@loongson.cn \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=robh+dt@kernel.org \
    --cc=zhuyinbo@loongson.cn \
    /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