Hi Sergey, url: https://github.com/0day-ci/linux/commits/Sergey-Shtylyov/Correctly-handle-plaform_get_irq-s-result-in-the-i2C-drivers/20210624-050805 base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next config: microblaze-randconfig-m031-20210628 (attached as .config) compiler: microblaze-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> smatch warnings: drivers/i2c/busses/i2c-pmcmsp.c:355 pmcmsptwi_probe() warn: 'pmcmsptwi_data.iobase' not released on lines: 296. drivers/i2c/busses/i2c-pmcmsp.c:355 pmcmsptwi_probe() warn: 'res->start' not released on lines: 296. vim +355 drivers/i2c/busses/i2c-pmcmsp.c 0b255e927d47b5 Bill Pemberton 2012-11-27 261 static int pmcmsptwi_probe(struct platform_device *pldev) 1b144df1d7d69d Marc St-Jean 2007-07-12 262 { 1b144df1d7d69d Marc St-Jean 2007-07-12 263 struct resource *res; 1b144df1d7d69d Marc St-Jean 2007-07-12 264 int rc = -ENODEV; 1b144df1d7d69d Marc St-Jean 2007-07-12 265 1b144df1d7d69d Marc St-Jean 2007-07-12 266 /* get the static platform resources */ 1b144df1d7d69d Marc St-Jean 2007-07-12 267 res = platform_get_resource(pldev, IORESOURCE_MEM, 0); 1b144df1d7d69d Marc St-Jean 2007-07-12 268 if (!res) { 1b144df1d7d69d Marc St-Jean 2007-07-12 269 dev_err(&pldev->dev, "IOMEM resource not found\n"); 1b144df1d7d69d Marc St-Jean 2007-07-12 270 goto ret_err; 1b144df1d7d69d Marc St-Jean 2007-07-12 271 } 1b144df1d7d69d Marc St-Jean 2007-07-12 272 1b144df1d7d69d Marc St-Jean 2007-07-12 273 /* reserve the memory region */ c6ffddea36dd57 Linus Walleij 2009-06-14 274 if (!request_mem_region(res->start, resource_size(res), 1b144df1d7d69d Marc St-Jean 2007-07-12 275 pldev->name)) { 1b144df1d7d69d Marc St-Jean 2007-07-12 276 dev_err(&pldev->dev, 066e6e805d4af2 Krzysztof Kozlowski 2020-01-15 277 "Unable to get memory/io address region %pap\n", 066e6e805d4af2 Krzysztof Kozlowski 2020-01-15 278 &res->start); 1b144df1d7d69d Marc St-Jean 2007-07-12 279 rc = -EBUSY; 1b144df1d7d69d Marc St-Jean 2007-07-12 280 goto ret_err; 1b144df1d7d69d Marc St-Jean 2007-07-12 281 } 1b144df1d7d69d Marc St-Jean 2007-07-12 282 1b144df1d7d69d Marc St-Jean 2007-07-12 283 /* remap the memory */ 4bdc0d676a6431 Christoph Hellwig 2020-01-06 284 pmcmsptwi_data.iobase = ioremap(res->start, c6ffddea36dd57 Linus Walleij 2009-06-14 285 resource_size(res)); 1b144df1d7d69d Marc St-Jean 2007-07-12 286 if (!pmcmsptwi_data.iobase) { 1b144df1d7d69d Marc St-Jean 2007-07-12 287 dev_err(&pldev->dev, 066e6e805d4af2 Krzysztof Kozlowski 2020-01-15 288 "Unable to ioremap address %pap\n", &res->start); 1b144df1d7d69d Marc St-Jean 2007-07-12 289 rc = -EIO; 1b144df1d7d69d Marc St-Jean 2007-07-12 290 goto ret_unreserve; 1b144df1d7d69d Marc St-Jean 2007-07-12 291 } 1b144df1d7d69d Marc St-Jean 2007-07-12 292 1b144df1d7d69d Marc St-Jean 2007-07-12 293 /* request the irq */ fa227704e6a1e0 Sergey Shtylyov 2021-06-23 294 rc = platform_get_irq(pldev, 0); fa227704e6a1e0 Sergey Shtylyov 2021-06-23 295 if (rc == -EPROBE_DEFER) fa227704e6a1e0 Sergey Shtylyov 2021-06-23 296 return rc; Need to clean up the ioremap() and the request_mem_region(). fa227704e6a1e0 Sergey Shtylyov 2021-06-23 297 if (rc <= 0) { fa227704e6a1e0 Sergey Shtylyov 2021-06-23 298 pmcmsptwi_data.irq = 0; fa227704e6a1e0 Sergey Shtylyov 2021-06-23 299 } else { fa227704e6a1e0 Sergey Shtylyov 2021-06-23 300 pmcmsptwi_data.irq = rc; 1b144df1d7d69d Marc St-Jean 2007-07-12 301 rc = request_irq(pmcmsptwi_data.irq, &pmcmsptwi_interrupt, d38a0149e8a11c Theodore Ts'o 2012-07-17 302 IRQF_SHARED, pldev->name, &pmcmsptwi_data); 1b144df1d7d69d Marc St-Jean 2007-07-12 303 if (rc == 0) { 1b144df1d7d69d Marc St-Jean 2007-07-12 304 /* 1b144df1d7d69d Marc St-Jean 2007-07-12 305 * Enable 'DONE' interrupt only. 1b144df1d7d69d Marc St-Jean 2007-07-12 306 * 1b144df1d7d69d Marc St-Jean 2007-07-12 307 * If you enable all interrupts, you will get one on 1b144df1d7d69d Marc St-Jean 2007-07-12 308 * error and another when the operation completes. 1b144df1d7d69d Marc St-Jean 2007-07-12 309 * This way you only have to handle one interrupt, 1b144df1d7d69d Marc St-Jean 2007-07-12 310 * but you can still check all result flags. 1b144df1d7d69d Marc St-Jean 2007-07-12 311 */ 1b144df1d7d69d Marc St-Jean 2007-07-12 312 pmcmsptwi_writel(MSP_TWI_INT_STS_DONE, 1b144df1d7d69d Marc St-Jean 2007-07-12 313 pmcmsptwi_data.iobase + 1b144df1d7d69d Marc St-Jean 2007-07-12 314 MSP_TWI_INT_MSK_REG_OFFSET); 1b144df1d7d69d Marc St-Jean 2007-07-12 315 } else { 1b144df1d7d69d Marc St-Jean 2007-07-12 316 dev_warn(&pldev->dev, 1b144df1d7d69d Marc St-Jean 2007-07-12 317 "Could not assign TWI IRQ handler " 1b144df1d7d69d Marc St-Jean 2007-07-12 318 "to irq %d (continuing with poll)\n", 1b144df1d7d69d Marc St-Jean 2007-07-12 319 pmcmsptwi_data.irq); 1b144df1d7d69d Marc St-Jean 2007-07-12 320 pmcmsptwi_data.irq = 0; 1b144df1d7d69d Marc St-Jean 2007-07-12 321 } 1b144df1d7d69d Marc St-Jean 2007-07-12 322 } 1b144df1d7d69d Marc St-Jean 2007-07-12 323 1b144df1d7d69d Marc St-Jean 2007-07-12 324 init_completion(&pmcmsptwi_data.wait); 1b144df1d7d69d Marc St-Jean 2007-07-12 325 mutex_init(&pmcmsptwi_data.lock); 1b144df1d7d69d Marc St-Jean 2007-07-12 326 1b144df1d7d69d Marc St-Jean 2007-07-12 327 pmcmsptwi_set_clock_config(&pmcmsptwi_defclockcfg, &pmcmsptwi_data); 1b144df1d7d69d Marc St-Jean 2007-07-12 328 pmcmsptwi_set_twi_config(&pmcmsptwi_defcfg, &pmcmsptwi_data); 1b144df1d7d69d Marc St-Jean 2007-07-12 329 1b144df1d7d69d Marc St-Jean 2007-07-12 330 printk(KERN_INFO DRV_NAME ": Registering MSP71xx I2C adapter\n"); 1b144df1d7d69d Marc St-Jean 2007-07-12 331 1b144df1d7d69d Marc St-Jean 2007-07-12 332 pmcmsptwi_adapter.dev.parent = &pldev->dev; 1b144df1d7d69d Marc St-Jean 2007-07-12 333 platform_set_drvdata(pldev, &pmcmsptwi_adapter); 1b144df1d7d69d Marc St-Jean 2007-07-12 334 i2c_set_adapdata(&pmcmsptwi_adapter, &pmcmsptwi_data); 1b144df1d7d69d Marc St-Jean 2007-07-12 335 1b144df1d7d69d Marc St-Jean 2007-07-12 336 rc = i2c_add_adapter(&pmcmsptwi_adapter); ea734404f3daf1 Wolfram Sang 2016-08-09 337 if (rc) 1b144df1d7d69d Marc St-Jean 2007-07-12 338 goto ret_unmap; 1b144df1d7d69d Marc St-Jean 2007-07-12 339 1b144df1d7d69d Marc St-Jean 2007-07-12 340 return 0; 1b144df1d7d69d Marc St-Jean 2007-07-12 341 1b144df1d7d69d Marc St-Jean 2007-07-12 342 ret_unmap: 1b144df1d7d69d Marc St-Jean 2007-07-12 343 if (pmcmsptwi_data.irq) { 1b144df1d7d69d Marc St-Jean 2007-07-12 344 pmcmsptwi_writel(0, 1b144df1d7d69d Marc St-Jean 2007-07-12 345 pmcmsptwi_data.iobase + MSP_TWI_INT_MSK_REG_OFFSET); 1b144df1d7d69d Marc St-Jean 2007-07-12 346 free_irq(pmcmsptwi_data.irq, &pmcmsptwi_data); 1b144df1d7d69d Marc St-Jean 2007-07-12 347 } 1b144df1d7d69d Marc St-Jean 2007-07-12 348 1b144df1d7d69d Marc St-Jean 2007-07-12 349 iounmap(pmcmsptwi_data.iobase); 1b144df1d7d69d Marc St-Jean 2007-07-12 350 1b144df1d7d69d Marc St-Jean 2007-07-12 351 ret_unreserve: c6ffddea36dd57 Linus Walleij 2009-06-14 352 release_mem_region(res->start, resource_size(res)); 1b144df1d7d69d Marc St-Jean 2007-07-12 353 1b144df1d7d69d Marc St-Jean 2007-07-12 354 ret_err: 1b144df1d7d69d Marc St-Jean 2007-07-12 @355 return rc; 1b144df1d7d69d Marc St-Jean 2007-07-12 356 } --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx _______________________________________________ kbuild mailing list -- kbuild@xxxxxxxxxxxx To unsubscribe send an email to kbuild-leave@xxxxxxxxxxxx