[xlnx:master 9663/10510] drivers/net/ethernet/xilinx/xilinx_axienet_main.c:2948 axienet_probe() warn: missing error code 'ret'

Dan Carpenter dan.carpenter at oracle.com
Wed Feb 10 07:10:27 EST 2021


tree:   https://github.com/Xilinx/linux-xlnx master
head:   d3774573d5a9700273bd0c3ff82af157107f7fa6
commit: 0f447249ba48721e24292b1ddacf1b4b4e21d9a7 [9663/10510] net: axienet: added multichannel DMA support
config: i386-randconfig-m021-20210209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
Reported-by: Dan Carpenter <dan.carpenter at oracle.com>

New smatch warnings:
drivers/net/ethernet/xilinx/xilinx_axienet_main.c:2948 axienet_probe() warn: missing error code 'ret'

Old smatch warnings:
drivers/net/ethernet/xilinx/xilinx_axienet_main.c:204 axienet_dma_bd_init() error: uninitialized symbol 'ret'.

vim +/ret +2948 drivers/net/ethernet/xilinx/xilinx_axienet_main.c

6a8544f2f4d900 Appana Durga Kedareswara Rao 2020-01-24  2931  	of_node_put(np);
6a8544f2f4d900 Appana Durga Kedareswara Rao 2020-01-24  2932  #endif
0f447249ba4872 Saurabh Sengar               2020-01-24  2933  	if (!slave) {
0f447249ba4872 Saurabh Sengar               2020-01-24  2934  #ifdef CONFIG_AXIENET_HAS_MCDMA
0f447249ba4872 Saurabh Sengar               2020-01-24  2935  		ret = axienet_mcdma_probe(pdev, lp, ndev);
0f447249ba4872 Saurabh Sengar               2020-01-24  2936  #else
0f447249ba4872 Saurabh Sengar               2020-01-24  2937  		ret = axienet_dma_probe(pdev, ndev);
0f447249ba4872 Saurabh Sengar               2020-01-24  2938  #endif
b482f0a0aa9973 Radhey Shyam Pandey          2020-01-24  2939  		if (ret) {
0f447249ba4872 Saurabh Sengar               2020-01-24  2940  			pr_err("Getting DMA resource failed\n");
46aa27df885321 Srikanth Thokala             2015-05-05  2941  			goto free_netdev;
8a3b7a252dca9f Daniel Borkmann              2012-01-19  2942  		}
9e8ce9d565663f Appana Durga Kedareswara Rao 2020-01-24  2943  
0f447249ba4872 Saurabh Sengar               2020-01-24  2944  		if (dma_set_mask_and_coherent(lp->dev, DMA_BIT_MASK(lp->dma_mask)) != 0) {
0f447249ba4872 Saurabh Sengar               2020-01-24  2945  			dev_warn(&pdev->dev, "default to %d-bit dma mask\n", XAE_DMA_MASK_MIN);
0f447249ba4872 Saurabh Sengar               2020-01-24  2946  			if (dma_set_mask_and_coherent(lp->dev, DMA_BIT_MASK(XAE_DMA_MASK_MIN)) != 0) {
0f447249ba4872 Saurabh Sengar               2020-01-24  2947  				dev_err(&pdev->dev, "dma_set_mask_and_coherent failed, aborting\n");
46aa27df885321 Srikanth Thokala             2015-05-05 @2948  				goto free_netdev;

ret is not set on this error path.

8a3b7a252dca9f Daniel Borkmann              2012-01-19  2949  			}
0f447249ba4872 Saurabh Sengar               2020-01-24  2950  		}
57b6ef54c85dd8 Appana Durga Kedareswara Rao 2020-01-24  2951  
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24  2952  		ret = axienet_dma_clk_init(pdev);
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24  2953  		if (ret) {
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24  2954  			if (ret != -EPROBE_DEFER)
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24  2955  				dev_err(&pdev->dev, "DMA clock init failed %d\n", ret);
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24  2956  			goto free_netdev;
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24  2957  		}
0f447249ba4872 Saurabh Sengar               2020-01-24  2958  	}
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24  2959  
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24  2960  	ret = axienet_clk_init(pdev, &lp->aclk, &lp->eth_sclk,

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 34786 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210210/e54fcd73/attachment-0001.gz>


More information about the linux-arm-kernel mailing list