lkml.org 
[lkml]   [2021]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdrivers/power/reset/at91-reset.c:260 at91_reset_probe() warn: 'reset->rstc_base' not released on lines: 244.
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 61556703b610a104de324e4f061dc6cf7b218b46
commit: b7967b7919f0e3787d6e23424b5ad367fbb937e2 power: reset: at91-reset: convert reset in pointer to struct at91_reset
config: arm-randconfig-m031-20210206 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 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/power/reset/at91-reset.c:260 at91_reset_probe() warn: 'reset->rstc_base' not released on lines: 244.

vim +260 drivers/power/reset/at91-reset.c

6e64180a7c0219 Alexandre Belloni 2015-08-11 209 static int __init at91_reset_probe(struct platform_device *pdev)
ecfe64d8c55f8f Maxime Ripard 2014-07-02 210 {
ecfe64d8c55f8f Maxime Ripard 2014-07-02 211 const struct of_device_id *match;
ecfe64d8c55f8f Maxime Ripard 2014-07-02 212 struct device_node *np;
eacd8d09db7f45 Alexandre Belloni 2015-08-11 213 int ret, idx = 0;
ecfe64d8c55f8f Maxime Ripard 2014-07-02 214
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 215 reset = devm_kzalloc(&pdev->dev, sizeof(*reset), GFP_KERNEL);
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 216 if (!reset)
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 217 return -ENOMEM;
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 218
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 219 reset->rstc_base = of_iomap(pdev->dev.of_node, 0);
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 220 if (!reset->rstc_base) {
ecfe64d8c55f8f Maxime Ripard 2014-07-02 221 dev_err(&pdev->dev, "Could not map reset controller address\n");
ecfe64d8c55f8f Maxime Ripard 2014-07-02 222 return -ENODEV;
ecfe64d8c55f8f Maxime Ripard 2014-07-02 223 }
ecfe64d8c55f8f Maxime Ripard 2014-07-02 224
1ae25d626cfe7e Josh Wu 2015-07-20 225 if (!of_device_is_compatible(pdev->dev.of_node, "atmel,sama5d3-rstc")) {
1ae25d626cfe7e Josh Wu 2015-07-20 226 /* we need to shutdown the ddr controller, so get ramc base */
ecfe64d8c55f8f Maxime Ripard 2014-07-02 227 for_each_matching_node(np, at91_ramc_of_match) {
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 228 reset->ramc_base[idx] = of_iomap(np, 0);
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 229 if (!reset->ramc_base[idx]) {
ecfe64d8c55f8f Maxime Ripard 2014-07-02 230 dev_err(&pdev->dev, "Could not map ram controller address\n");
c4c0edfbf875a5 Julia Lawall 2015-11-18 231 of_node_put(np);
ecfe64d8c55f8f Maxime Ripard 2014-07-02 232 return -ENODEV;

These error paths should probably unmap "reset->rstc_base"?

ecfe64d8c55f8f Maxime Ripard 2014-07-02 233 }
ecfe64d8c55f8f Maxime Ripard 2014-07-02 234 idx++;
ecfe64d8c55f8f Maxime Ripard 2014-07-02 235 }
1ae25d626cfe7e Josh Wu 2015-07-20 236 }
ecfe64d8c55f8f Maxime Ripard 2014-07-02 237
ecfe64d8c55f8f Maxime Ripard 2014-07-02 238 match = of_match_node(at91_reset_of_match, pdev->dev.of_node);
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 239 reset->nb.notifier_call = match->data;
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 240 reset->nb.priority = 192;
ecfe64d8c55f8f Maxime Ripard 2014-07-02 241
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 242 reset->sclk = devm_clk_get(&pdev->dev, NULL);
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 243 if (IS_ERR(reset->sclk))
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 244 return PTR_ERR(reset->sclk);

Etc. These should probably unmap reset->ramc_base[].

2b2c6148fe8510 Alexandre Belloni 2015-08-11 245
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 246 ret = clk_prepare_enable(reset->sclk);
2b2c6148fe8510 Alexandre Belloni 2015-08-11 247 if (ret) {
2b2c6148fe8510 Alexandre Belloni 2015-08-11 248 dev_err(&pdev->dev, "Could not enable slow clock\n");
2b2c6148fe8510 Alexandre Belloni 2015-08-11 249 return ret;
2b2c6148fe8510 Alexandre Belloni 2015-08-11 250 }
2b2c6148fe8510 Alexandre Belloni 2015-08-11 251
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 252 ret = register_restart_handler(&reset->nb);
2b2c6148fe8510 Alexandre Belloni 2015-08-11 253 if (ret) {
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21 254 clk_disable_unprepare(reset->sclk);
ecfe64d8c55f8f Maxime Ripard 2014-07-02 255 return ret;
2b2c6148fe8510 Alexandre Belloni 2015-08-11 256 }
ecfe64d8c55f8f Maxime Ripard 2014-07-02 257
ecfe64d8c55f8f Maxime Ripard 2014-07-02 258 at91_reset_status(pdev);
ecfe64d8c55f8f Maxime Ripard 2014-07-02 259
ecfe64d8c55f8f Maxime Ripard 2014-07-02 @260 return 0;
ecfe64d8c55f8f Maxime Ripard 2014-07-02 261 }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2021-02-08 14:27    [W:0.054 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site