All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 1683/7959] drivers/net/ethernet/mediatek/mtk_wed.c:813:2-8: ERROR: missing put_device; call of_find_device_by_node on line 806, but without a corresponding object release within this function.
@ 2022-04-29 14:38 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-04-29 14:38 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6733 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Felix Fietkau <nbd@nbd.name>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   5469f0c06732a077c70a759a81f2a1f00b277694
commit: 804775dfc2885e93a0a4b35db1914c2cc25172b5 [1683/7959] net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)
:::::: branch date: 7 hours ago
:::::: commit date: 3 weeks ago
config: arm64-randconfig-c004-20220428 (https://download.01.org/0day-ci/archive/20220429/202204292241.RP7yyzWn-lkp(a)intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


cocci warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/mediatek/mtk_wed.c:813:2-8: ERROR: missing put_device; call of_find_device_by_node on line 806, but without a corresponding object release within this function.
   drivers/net/ethernet/mediatek/mtk_wed.c:817:2-8: ERROR: missing put_device; call of_find_device_by_node on line 806, but without a corresponding object release within this function.
   drivers/net/ethernet/mediatek/mtk_wed.c:853:0-1: ERROR: missing put_device; call of_find_device_by_node on line 806, but without a corresponding object release within this function.

vim +813 drivers/net/ethernet/mediatek/mtk_wed.c

804775dfc2885e9 Felix Fietkau 2022-04-05  780  
804775dfc2885e9 Felix Fietkau 2022-04-05  781  void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
804775dfc2885e9 Felix Fietkau 2022-04-05  782  		    void __iomem *wdma, int index)
804775dfc2885e9 Felix Fietkau 2022-04-05  783  {
804775dfc2885e9 Felix Fietkau 2022-04-05  784  	static const struct mtk_wed_ops wed_ops = {
804775dfc2885e9 Felix Fietkau 2022-04-05  785  		.attach = mtk_wed_attach,
804775dfc2885e9 Felix Fietkau 2022-04-05  786  		.tx_ring_setup = mtk_wed_tx_ring_setup,
804775dfc2885e9 Felix Fietkau 2022-04-05  787  		.txfree_ring_setup = mtk_wed_txfree_ring_setup,
804775dfc2885e9 Felix Fietkau 2022-04-05  788  		.start = mtk_wed_start,
804775dfc2885e9 Felix Fietkau 2022-04-05  789  		.stop = mtk_wed_stop,
804775dfc2885e9 Felix Fietkau 2022-04-05  790  		.reset_dma = mtk_wed_reset_dma,
804775dfc2885e9 Felix Fietkau 2022-04-05  791  		.reg_read = wed_r32,
804775dfc2885e9 Felix Fietkau 2022-04-05  792  		.reg_write = wed_w32,
804775dfc2885e9 Felix Fietkau 2022-04-05  793  		.irq_get = mtk_wed_irq_get,
804775dfc2885e9 Felix Fietkau 2022-04-05  794  		.irq_set_mask = mtk_wed_irq_set_mask,
804775dfc2885e9 Felix Fietkau 2022-04-05  795  		.detach = mtk_wed_detach,
804775dfc2885e9 Felix Fietkau 2022-04-05  796  	};
804775dfc2885e9 Felix Fietkau 2022-04-05  797  	struct device_node *eth_np = eth->dev->of_node;
804775dfc2885e9 Felix Fietkau 2022-04-05  798  	struct platform_device *pdev;
804775dfc2885e9 Felix Fietkau 2022-04-05  799  	struct mtk_wed_hw *hw;
804775dfc2885e9 Felix Fietkau 2022-04-05  800  	struct regmap *regs;
804775dfc2885e9 Felix Fietkau 2022-04-05  801  	int irq;
804775dfc2885e9 Felix Fietkau 2022-04-05  802  
804775dfc2885e9 Felix Fietkau 2022-04-05  803  	if (!np)
804775dfc2885e9 Felix Fietkau 2022-04-05  804  		return;
804775dfc2885e9 Felix Fietkau 2022-04-05  805  
804775dfc2885e9 Felix Fietkau 2022-04-05 @806  	pdev = of_find_device_by_node(np);
804775dfc2885e9 Felix Fietkau 2022-04-05  807  	if (!pdev)
804775dfc2885e9 Felix Fietkau 2022-04-05  808  		return;
804775dfc2885e9 Felix Fietkau 2022-04-05  809  
804775dfc2885e9 Felix Fietkau 2022-04-05  810  	get_device(&pdev->dev);
804775dfc2885e9 Felix Fietkau 2022-04-05  811  	irq = platform_get_irq(pdev, 0);
804775dfc2885e9 Felix Fietkau 2022-04-05  812  	if (irq < 0)
804775dfc2885e9 Felix Fietkau 2022-04-05 @813  		return;
804775dfc2885e9 Felix Fietkau 2022-04-05  814  
804775dfc2885e9 Felix Fietkau 2022-04-05  815  	regs = syscon_regmap_lookup_by_phandle(np, NULL);
804775dfc2885e9 Felix Fietkau 2022-04-05  816  	if (!regs)
804775dfc2885e9 Felix Fietkau 2022-04-05  817  		return;
804775dfc2885e9 Felix Fietkau 2022-04-05  818  
804775dfc2885e9 Felix Fietkau 2022-04-05  819  	rcu_assign_pointer(mtk_soc_wed_ops, &wed_ops);
804775dfc2885e9 Felix Fietkau 2022-04-05  820  
804775dfc2885e9 Felix Fietkau 2022-04-05  821  	mutex_lock(&hw_lock);
804775dfc2885e9 Felix Fietkau 2022-04-05  822  
804775dfc2885e9 Felix Fietkau 2022-04-05  823  	if (WARN_ON(hw_list[index]))
804775dfc2885e9 Felix Fietkau 2022-04-05  824  		goto unlock;
804775dfc2885e9 Felix Fietkau 2022-04-05  825  
804775dfc2885e9 Felix Fietkau 2022-04-05  826  	hw = kzalloc(sizeof(*hw), GFP_KERNEL);
804775dfc2885e9 Felix Fietkau 2022-04-05  827  	hw->node = np;
804775dfc2885e9 Felix Fietkau 2022-04-05  828  	hw->regs = regs;
804775dfc2885e9 Felix Fietkau 2022-04-05  829  	hw->eth = eth;
804775dfc2885e9 Felix Fietkau 2022-04-05  830  	hw->dev = &pdev->dev;
804775dfc2885e9 Felix Fietkau 2022-04-05  831  	hw->wdma = wdma;
804775dfc2885e9 Felix Fietkau 2022-04-05  832  	hw->index = index;
804775dfc2885e9 Felix Fietkau 2022-04-05  833  	hw->irq = irq;
804775dfc2885e9 Felix Fietkau 2022-04-05  834  	hw->mirror = syscon_regmap_lookup_by_phandle(eth_np,
804775dfc2885e9 Felix Fietkau 2022-04-05  835  						     "mediatek,pcie-mirror");
804775dfc2885e9 Felix Fietkau 2022-04-05  836  	hw->hifsys = syscon_regmap_lookup_by_phandle(eth_np,
804775dfc2885e9 Felix Fietkau 2022-04-05  837  						     "mediatek,hifsys");
804775dfc2885e9 Felix Fietkau 2022-04-05  838  	if (IS_ERR(hw->mirror) || IS_ERR(hw->hifsys)) {
804775dfc2885e9 Felix Fietkau 2022-04-05  839  		kfree(hw);
804775dfc2885e9 Felix Fietkau 2022-04-05  840  		goto unlock;
804775dfc2885e9 Felix Fietkau 2022-04-05  841  	}
804775dfc2885e9 Felix Fietkau 2022-04-05  842  
804775dfc2885e9 Felix Fietkau 2022-04-05  843  	if (!index) {
804775dfc2885e9 Felix Fietkau 2022-04-05  844  		regmap_write(hw->mirror, 0, 0);
804775dfc2885e9 Felix Fietkau 2022-04-05  845  		regmap_write(hw->mirror, 4, 0);
804775dfc2885e9 Felix Fietkau 2022-04-05  846  	}
804775dfc2885e9 Felix Fietkau 2022-04-05  847  	mtk_wed_hw_add_debugfs(hw);
804775dfc2885e9 Felix Fietkau 2022-04-05  848  
804775dfc2885e9 Felix Fietkau 2022-04-05  849  	hw_list[index] = hw;
804775dfc2885e9 Felix Fietkau 2022-04-05  850  
804775dfc2885e9 Felix Fietkau 2022-04-05  851  unlock:
804775dfc2885e9 Felix Fietkau 2022-04-05  852  	mutex_unlock(&hw_lock);
804775dfc2885e9 Felix Fietkau 2022-04-05  853  }
804775dfc2885e9 Felix Fietkau 2022-04-05  854  

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-29 14:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29 14:38 [linux-next:master 1683/7959] drivers/net/ethernet/mediatek/mtk_wed.c:813:2-8: ERROR: missing put_device; call of_find_device_by_node on line 806, but without a corresponding object release within this function 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.