lkml.org 
[lkml]   [2021]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdrivers/net/mdio/mdio-ipq8064.c:148 ipq8064_mdio_probe() warn: 'base' not released on lines: 129,141.
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dbe69e43372212527abf48609aba7fc39a6daa27
commit: b097bea10215315e8ee17f88b4c1bbb521b1878c net: mdio: ipq8064: add regmap config to disable REGCACHE
config: i386-randconfig-m021-20210630 (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/net/mdio/mdio-ipq8064.c:148 ipq8064_mdio_probe() warn: 'base' not released on lines: 129,141.

vim +/base +148 drivers/net/mdio/mdio-ipq8064.c

caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 110 static int
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 111 ipq8064_mdio_probe(struct platform_device *pdev)
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 112 {
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 113 struct device_node *np = pdev->dev.of_node;
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 114 struct ipq8064_mdio *priv;
b097bea1021531 drivers/net/mdio/mdio-ipq8064.c Ansuel Smith 2021-05-14 115 struct resource res;
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 116 struct mii_bus *bus;
b097bea1021531 drivers/net/mdio/mdio-ipq8064.c Ansuel Smith 2021-05-14 117 void __iomem *base;
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 118 int ret;
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 119
b097bea1021531 drivers/net/mdio/mdio-ipq8064.c Ansuel Smith 2021-05-14 120 if (of_address_to_resource(np, 0, &res))
b097bea1021531 drivers/net/mdio/mdio-ipq8064.c Ansuel Smith 2021-05-14 121 return -ENOMEM;
b097bea1021531 drivers/net/mdio/mdio-ipq8064.c Ansuel Smith 2021-05-14 122
b097bea1021531 drivers/net/mdio/mdio-ipq8064.c Ansuel Smith 2021-05-14 123 base = ioremap(res.start, resource_size(&res));

Use devm_ioremap()

b097bea1021531 drivers/net/mdio/mdio-ipq8064.c Ansuel Smith 2021-05-14 124 if (!base)
b097bea1021531 drivers/net/mdio/mdio-ipq8064.c Ansuel Smith 2021-05-14 125 return -ENOMEM;
b097bea1021531 drivers/net/mdio/mdio-ipq8064.c Ansuel Smith 2021-05-14 126
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 127 bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*priv));
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 128 if (!bus)
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 129 return -ENOMEM;
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 130
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 131 bus->name = "ipq8064_mdio_bus";
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 132 bus->read = ipq8064_mdio_read;
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 133 bus->write = ipq8064_mdio_write;
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 134 snprintf(bus->id, MII_BUS_ID_SIZE, "%s-mii", dev_name(&pdev->dev));
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 135 bus->parent = &pdev->dev;
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 136
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 137 priv = bus->priv;
b097bea1021531 drivers/net/mdio/mdio-ipq8064.c Ansuel Smith 2021-05-14 138 priv->base = devm_regmap_init_mmio(&pdev->dev, base,
b097bea1021531 drivers/net/mdio/mdio-ipq8064.c Ansuel Smith 2021-05-14 139 &ipq8064_mdio_regmap_config);
b097bea1021531 drivers/net/mdio/mdio-ipq8064.c Ansuel Smith 2021-05-14 140 if (IS_ERR(priv->base))
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 141 return PTR_ERR(priv->base);
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 142
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 143 ret = of_mdiobus_register(bus, np);
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 144 if (ret)
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 145 return ret;
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 146
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 147 platform_set_drvdata(pdev, bus);
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 @148 return 0;
caaa71fac36ec8 drivers/net/phy/mdio-ipq8064.c Ansuel Smith 2020-03-04 149 }

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

\
 
 \ /
  Last update: 2021-07-02 10:39    [W:0.060 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site