lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202208061445.5jD7uQha-lkp@intel.com>
Date:   Sat, 6 Aug 2022 14:43:57 +0800
From:   kernel test robot <lkp@...el.com>
To:     Tudor Ambarus <tudor.ambarus@...rochip.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [ambarus:at-hdmac-virt-dma-for-mainline 19/24]
 drivers/dma/at_hdmac.c:2484:1-6: WARNING: invalid free of devm_ allocated
 data

tree:   https://github.com/ambarus/linux-0day at-hdmac-virt-dma-for-mainline
head:   71023d1cc2a923b031eda6f5002704e88c52d9bf
commit: 97345ba39da3b6afa4bebc4354a884ac7cbf550b [19/24] dmaengine: at_hdmac: Use devm_kzalloc() and struct_size()
config: arm-randconfig-c043-20220805 (https://download.01.org/0day-ci/archive/20220806/202208061445.5jD7uQha-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>

cocci warnings: (new ones prefixed by >>)
>> drivers/dma/at_hdmac.c:2484:1-6: WARNING: invalid free of devm_ allocated data

vim +2484 drivers/dma/at_hdmac.c

dc78baa2b90b28 Nicolas Ferre     2009-07-03  2448  
1d1bbd305a7831 Maxin B. John     2013-02-20  2449  static int at_dma_remove(struct platform_device *pdev)
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2450  {
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2451  	struct at_dma		*atdma = platform_get_drvdata(pdev);
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2452  	struct dma_chan		*chan, *_chan;
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2453  	struct resource		*io;
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2454  
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2455  	at_dma_off(atdma);
77e75fda94d2eb Richard Genoud    2018-11-27  2456  	if (pdev->dev.of_node)
77e75fda94d2eb Richard Genoud    2018-11-27  2457  		of_dma_controller_free(pdev->dev.of_node);
13ec2a5d2d98bb Tudor Ambarus     2022-07-04  2458  	dma_async_device_unregister(&atdma->dma_device);
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2459  
4d112426c3446d Maxime Ripard     2015-08-24  2460  	dma_pool_destroy(atdma->memset_pool);
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2461  	dma_pool_destroy(atdma->dma_desc_pool);
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2462  	free_irq(platform_get_irq(pdev, 0), atdma);
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2463  
13ec2a5d2d98bb Tudor Ambarus     2022-07-04  2464  	list_for_each_entry_safe(chan, _chan, &atdma->dma_device.channels,
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2465  			device_node) {
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2466  		struct at_dma_chan	*atchan = to_at_dma_chan(chan);
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2467  
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2468  		/* Disable interrupts */
bda3a47c886664 Nikolaus Voss     2012-01-17  2469  		atc_disable_chan_irq(atdma, chan->chan_id);
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2470  
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2471  		tasklet_kill(&atchan->tasklet);
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2472  		list_del(&chan->device_node);
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2473  	}
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2474  
f784d9c90469d7 Boris Brezillon   2013-06-19  2475  	clk_disable_unprepare(atdma->clk);
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2476  	clk_put(atdma->clk);
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2477  
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2478  	iounmap(atdma->regs);
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2479  	atdma->regs = NULL;
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2480  
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2481  	io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
114df7d66efd5c H Hartley Sweeten 2011-06-01  2482  	release_mem_region(io->start, resource_size(io));
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2483  
dc78baa2b90b28 Nicolas Ferre     2009-07-03 @2484  	kfree(atdma);
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2485  
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2486  	return 0;
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2487  }
dc78baa2b90b28 Nicolas Ferre     2009-07-03  2488  

:::::: The code at line 2484 was first introduced by commit
:::::: dc78baa2b90b289590911b40b6800f77d0dc935a dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller

:::::: TO: Nicolas Ferre <nicolas.ferre@...el.com>
:::::: CC: Dan Williams <dan.j.williams@...el.com>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ