* drivers/dax/bus.c:811 alloc_dev_dax_range() warn: 'start' not released on lines: 783.
@ 2021-05-11 17:59 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-05-11 17:59 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 5730 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Zhen Lei <thunder.leizhen@huawei.com>
CC: Dan Williams <dan.j.williams@intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1140ab592e2ebf8153d2b322604031a8868ce7a5
commit: ff8da37d3d8d438ded5a4841d979899269b94d0d device-dax: Avoid an unnecessary check in alloc_dev_dax_range()
date: 5 months ago
:::::: branch date: 20 hours ago
:::::: commit date: 5 months ago
config: x86_64-randconfig-m031-20210511 (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/dax/bus.c:811 alloc_dev_dax_range() warn: 'start' not released on lines: 783.
vim +/start +811 drivers/dax/bus.c
0b07ce872a9eca Dan Williams 2020-10-13 752
fcffb6a1df921c Dan Williams 2020-10-13 753 static int alloc_dev_dax_range(struct dev_dax *dev_dax, u64 start,
fcffb6a1df921c Dan Williams 2020-10-13 754 resource_size_t size)
c2f3011ee697f8 Dan Williams 2020-10-13 755 {
c2f3011ee697f8 Dan Williams 2020-10-13 756 struct dax_region *dax_region = dev_dax->region;
c2f3011ee697f8 Dan Williams 2020-10-13 757 struct resource *res = &dax_region->res;
c2f3011ee697f8 Dan Williams 2020-10-13 758 struct device *dev = &dev_dax->dev;
60e93dc097f7f1 Dan Williams 2020-10-13 759 struct dev_dax_range *ranges;
60e93dc097f7f1 Dan Williams 2020-10-13 760 unsigned long pgoff = 0;
c2f3011ee697f8 Dan Williams 2020-10-13 761 struct resource *alloc;
0b07ce872a9eca Dan Williams 2020-10-13 762 int i, rc;
c2f3011ee697f8 Dan Williams 2020-10-13 763
c2f3011ee697f8 Dan Williams 2020-10-13 764 device_lock_assert(dax_region->dev);
c2f3011ee697f8 Dan Williams 2020-10-13 765
0f3da14a4f0503 Dan Williams 2020-10-13 766 /* handle the seed alloc special case */
0f3da14a4f0503 Dan Williams 2020-10-13 767 if (!size) {
60e93dc097f7f1 Dan Williams 2020-10-13 768 if (dev_WARN_ONCE(dev, dev_dax->nr_range,
60e93dc097f7f1 Dan Williams 2020-10-13 769 "0-size allocation must be first\n"))
60e93dc097f7f1 Dan Williams 2020-10-13 770 return -EBUSY;
60e93dc097f7f1 Dan Williams 2020-10-13 771 /* nr_range == 0 is elsewhere special cased as 0-size device */
0f3da14a4f0503 Dan Williams 2020-10-13 772 return 0;
0f3da14a4f0503 Dan Williams 2020-10-13 773 }
0f3da14a4f0503 Dan Williams 2020-10-13 774
ff8da37d3d8d43 Zhen Lei 2020-12-19 775 alloc = __request_region(res, start, size, dev_name(dev), 0);
ff8da37d3d8d43 Zhen Lei 2020-12-19 776 if (!alloc)
60e93dc097f7f1 Dan Williams 2020-10-13 777 return -ENOMEM;
60e93dc097f7f1 Dan Williams 2020-10-13 778
ff8da37d3d8d43 Zhen Lei 2020-12-19 779 ranges = krealloc(dev_dax->ranges, sizeof(*ranges)
ff8da37d3d8d43 Zhen Lei 2020-12-19 780 * (dev_dax->nr_range + 1), GFP_KERNEL);
ff8da37d3d8d43 Zhen Lei 2020-12-19 781 if (!ranges) {
ff8da37d3d8d43 Zhen Lei 2020-12-19 782 __release_region(res, alloc->start, resource_size(alloc));
c2f3011ee697f8 Dan Williams 2020-10-13 783 return -ENOMEM;
60e93dc097f7f1 Dan Williams 2020-10-13 784 }
c2f3011ee697f8 Dan Williams 2020-10-13 785
60e93dc097f7f1 Dan Williams 2020-10-13 786 for (i = 0; i < dev_dax->nr_range; i++)
60e93dc097f7f1 Dan Williams 2020-10-13 787 pgoff += PHYS_PFN(range_len(&ranges[i].range));
60e93dc097f7f1 Dan Williams 2020-10-13 788 dev_dax->ranges = ranges;
60e93dc097f7f1 Dan Williams 2020-10-13 789 ranges[dev_dax->nr_range++] = (struct dev_dax_range) {
60e93dc097f7f1 Dan Williams 2020-10-13 790 .pgoff = pgoff,
60e93dc097f7f1 Dan Williams 2020-10-13 791 .range = {
c2f3011ee697f8 Dan Williams 2020-10-13 792 .start = alloc->start,
c2f3011ee697f8 Dan Williams 2020-10-13 793 .end = alloc->end,
60e93dc097f7f1 Dan Williams 2020-10-13 794 },
c2f3011ee697f8 Dan Williams 2020-10-13 795 };
c2f3011ee697f8 Dan Williams 2020-10-13 796
60e93dc097f7f1 Dan Williams 2020-10-13 797 dev_dbg(dev, "alloc range[%d]: %pa:%pa\n", dev_dax->nr_range - 1,
60e93dc097f7f1 Dan Williams 2020-10-13 798 &alloc->start, &alloc->end);
0b07ce872a9eca Dan Williams 2020-10-13 799 /*
0b07ce872a9eca Dan Williams 2020-10-13 800 * A dev_dax instance must be registered before mapping device
0b07ce872a9eca Dan Williams 2020-10-13 801 * children can be added. Defer to devm_create_dev_dax() to add
0b07ce872a9eca Dan Williams 2020-10-13 802 * the initial mapping device.
0b07ce872a9eca Dan Williams 2020-10-13 803 */
0b07ce872a9eca Dan Williams 2020-10-13 804 if (!device_is_registered(&dev_dax->dev))
0b07ce872a9eca Dan Williams 2020-10-13 805 return 0;
0b07ce872a9eca Dan Williams 2020-10-13 806
0b07ce872a9eca Dan Williams 2020-10-13 807 rc = devm_register_dax_mapping(dev_dax, dev_dax->nr_range - 1);
6268d7da4d192a Dan Williams 2020-12-18 808 if (rc)
6268d7da4d192a Dan Williams 2020-12-18 809 trim_dev_dax_range(dev_dax);
60e93dc097f7f1 Dan Williams 2020-10-13 810
6268d7da4d192a Dan Williams 2020-12-18 @811 return rc;
c2f3011ee697f8 Dan Williams 2020-10-13 812 }
c2f3011ee697f8 Dan Williams 2020-10-13 813
:::::: The code at line 811 was first introduced by commit
:::::: 6268d7da4d192af339f4d688942b9ccb45a65e04 device-dax: Fix range release
:::::: TO: Dan Williams <dan.j.williams@intel.com>
:::::: CC: Dan Williams <dan.j.williams@intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36601 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-11 17:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11 17:59 drivers/dax/bus.c:811 alloc_dev_dax_range() warn: 'start' not released on lines: 783 kernel test robot
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.