From: kbuild test robot <lkp@intel.com>
To: Jeffy Chen <jeffy.chen@rock-chips.com>
Cc: kbuild-all@01.org, linux-pci@vger.kernel.org, robh@kernel.org,
toshi.kani@hpe.com, shawn.lin@rock-chips.com,
briannorris@chromium.org, linux-kernel@vger.kernel.org,
dianders@chromium.org, bhelgaas@google.com, dtor@chromium.org,
Jeffy Chen <jeffy.chen@rock-chips.com>,
devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>
Subject: Re: [PATCH v4] of/pci: Fix memory leak in of_pci_get_host_bridge_resources
Date: Thu, 6 Apr 2017 01:36:34 +0800 [thread overview]
Message-ID: <201704060102.sjrsMgUH%fengguang.wu@intel.com> (raw)
In-Reply-To: <1491358521-17834-2-git-send-email-jeffy.chen@rock-chips.com>
[-- Attachment #1: Type: text/plain, Size: 4036 bytes --]
Hi Jeffy,
[auto build test ERROR on pci/next]
[also build test ERROR on v4.11-rc5 next-20170405]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Jeffy-Chen/of-pci-Fix-memory-leak-in-of_pci_get_host_bridge_resources/20170406-005941
base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: i386-randconfig-n0-04051821 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
drivers//of/of_pci.c: In function 'of_pci_get_host_bridge_resources':
>> drivers//of/of_pci.c:215:30: error: incompatible type for argument 2 of 'pci_add_resource'
pci_add_resource(resources, res);
^~~
In file included from include/linux/of_pci.h:4:0,
from drivers//of/of_pci.c:8:
include/linux/pci.h:1152:6: note: expected 'struct resource *' but argument is of type 'struct resource'
void pci_add_resource(struct list_head *resources, struct resource *res);
^~~~~~~~~~~~~~~~
>> drivers//of/of_pci.c:261:9: error: invalid type argument of '->' (have 'struct resource')
res->start - range.pci_addr);
^~
>> drivers//of/of_pci.c:260:38: error: incompatible type for argument 2 of 'pci_add_resource_offset'
pci_add_resource_offset(resources, res,
^~~
In file included from include/linux/of_pci.h:4:0,
from drivers//of/of_pci.c:8:
include/linux/pci.h:1153:6: note: expected 'struct resource *' but argument is of type 'struct resource'
void pci_add_resource_offset(struct list_head *resources, struct resource *res,
^~~~~~~~~~~~~~~~~~~~~~~
vim +/pci_add_resource +215 drivers//of/of_pci.c
209 } else {
210 if (res.end > res.start + bus_max)
211 res.end = res.start + bus_max;
212 }
213
214 res.flags |= IORESOURCE_AUTO;
> 215 pci_add_resource(resources, res);
216
217 /* Check for ranges property */
218 err = of_pci_range_parser_init(&parser, dev);
219 if (err)
220 goto parse_failed;
221
222 pr_debug("Parsing ranges property...\n");
223 for_each_of_pci_range(&parser, &range) {
224 /* Read next ranges element */
225 if ((range.flags & IORESOURCE_TYPE_BITS) == IORESOURCE_IO)
226 snprintf(range_type, 4, " IO");
227 else if ((range.flags & IORESOURCE_TYPE_BITS) == IORESOURCE_MEM)
228 snprintf(range_type, 4, "MEM");
229 else
230 snprintf(range_type, 4, "err");
231 pr_info(" %s %#010llx..%#010llx -> %#010llx\n", range_type,
232 range.cpu_addr, range.cpu_addr + range.size - 1,
233 range.pci_addr);
234
235 /*
236 * If we failed translation or got a zero-sized region
237 * then skip this range
238 */
239 if (range.cpu_addr == OF_BAD_ADDR || range.size == 0)
240 continue;
241
242 err = of_pci_range_to_resource(&range, dev, &res);
243 if (err)
244 continue;
245
246 if (resource_type(&res) == IORESOURCE_IO) {
247 if (!io_base) {
248 pr_err("I/O range found for %s. Please provide an io_base pointer to save CPU base address\n",
249 dev->full_name);
250 err = -EINVAL;
251 goto parse_failed;
252 }
253 if (*io_base != (resource_size_t)OF_BAD_ADDR)
254 pr_warn("More than one I/O resource converted for %s. CPU base address for old range lost!\n",
255 dev->full_name);
256 *io_base = range.cpu_addr;
257 }
258
259 res.flags |= IORESOURCE_AUTO;
> 260 pci_add_resource_offset(resources, res,
> 261 res->start - range.pci_addr);
262 }
263
264 return 0;
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25202 bytes --]
next prev parent reply other threads:[~2017-04-05 17:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-05 2:15 [PATCH v4 0/1] " Jeffy Chen
2017-04-05 2:15 ` [PATCH v4] of/pci: " Jeffy Chen
2017-04-05 17:36 ` kbuild test robot [this message]
2017-04-05 17:39 ` kbuild 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=201704060102.sjrsMgUH%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=bhelgaas@google.com \
--cc=briannorris@chromium.org \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=dtor@chromium.org \
--cc=frowand.list@gmail.com \
--cc=jeffy.chen@rock-chips.com \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=toshi.kani@hpe.com \
/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
all inboxes | Powered by JetHome®