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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202011132221.bWo7iiXd-lkp@intel.com>
Date:   Fri, 13 Nov 2020 22:17:13 +0800
From:   kernel test robot <lkp@...el.com>
To:     Alexandru Ardelean <alexandru.ardelean@...log.com>,
        linux-kernel@...r.kernel.org
Cc:     kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
        gregkh@...uxfoundation.org,
        Alexandru Ardelean <alexandru.ardelean@...log.com>
Subject: Re: [PATCH 2/2] uio: pruss: use devm_clk_get() for clk init

Hi Alexandru,

I love your patch! Perhaps something to improve:

[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on linus/master linux/master v5.10-rc3 next-20201113]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alexandru-Ardelean/uio-pruss-move-simple-allocations-to-dem_-equivalents/20201111-192014
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 1987f112f1425cba2671d878f6952087e9456a0a
config: riscv-randconfig-r003-20201111 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 874b0a0b9db93f5d3350ffe6b5efda2d908415d0)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/37416440d4299a08c6f1a2dc448f7e9249f303ad
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alexandru-Ardelean/uio-pruss-move-simple-allocations-to-dem_-equivalents/20201111-192014
        git checkout 37416440d4299a08c6f1a2dc448f7e9249f303ad
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 

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

All warnings (new ones prefixed by >>):

>> drivers/uio/uio_pruss.c:136:10: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
                   return ret;
                          ^~~
   drivers/uio/uio_pruss.c:121:9: note: initialize the variable 'ret' to silence this warning
           int ret, cnt, i, len;
                  ^
                   = 0
   1 warning generated.

vim +/ret +136 drivers/uio/uio_pruss.c

   114	
   115	static int pruss_probe(struct platform_device *pdev)
   116	{
   117		struct uio_info *p;
   118		struct uio_pruss_dev *gdev;
   119		struct resource *regs_prussio;
   120		struct device *dev = &pdev->dev;
   121		int ret, cnt, i, len;
   122		struct uio_pruss_pdata *pdata = dev_get_platdata(dev);
   123	
   124		gdev = devm_kzalloc(dev, sizeof(struct uio_pruss_dev), GFP_KERNEL);
   125		if (!gdev)
   126			return -ENOMEM;
   127	
   128		gdev->info = devm_kcalloc(dev, MAX_PRUSS_EVT, sizeof(*p), GFP_KERNEL);
   129		if (!gdev->info)
   130			return -ENOMEM;
   131	
   132		/* Power on PRU in case its not done as part of boot-loader */
   133		gdev->pruss_clk = devm_clk_get(dev, "pruss");
   134		if (IS_ERR(gdev->pruss_clk)) {
   135			dev_err(dev, "Failed to get clock\n");
 > 136			return ret;
   137		}
   138	
   139		ret = clk_enable(gdev->pruss_clk);
   140		if (ret) {
   141			dev_err(dev, "Failed to enable clock\n");
   142			return ret;
   143		}
   144	
   145		regs_prussio = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   146		if (!regs_prussio) {
   147			dev_err(dev, "No PRUSS I/O resource specified\n");
   148			ret = -EIO;
   149			goto err_clk_disable;
   150		}
   151	
   152		if (!regs_prussio->start) {
   153			dev_err(dev, "Invalid memory resource\n");
   154			ret = -EIO;
   155			goto err_clk_disable;
   156		}
   157	
   158		if (pdata->sram_pool) {
   159			gdev->sram_pool = pdata->sram_pool;
   160			gdev->sram_vaddr =
   161				(unsigned long)gen_pool_dma_alloc(gdev->sram_pool,
   162						sram_pool_sz, &gdev->sram_paddr);
   163			if (!gdev->sram_vaddr) {
   164				dev_err(dev, "Could not allocate SRAM pool\n");
   165				ret = -ENOMEM;
   166				goto err_clk_disable;
   167			}
   168		}
   169	
   170		gdev->ddr_vaddr = dma_alloc_coherent(dev, extram_pool_sz,
   171					&(gdev->ddr_paddr), GFP_KERNEL | GFP_DMA);
   172		if (!gdev->ddr_vaddr) {
   173			dev_err(dev, "Could not allocate external memory\n");
   174			ret = -ENOMEM;
   175			goto err_free_sram;
   176		}
   177	
   178		len = resource_size(regs_prussio);
   179		gdev->prussio_vaddr = ioremap(regs_prussio->start, len);
   180		if (!gdev->prussio_vaddr) {
   181			dev_err(dev, "Can't remap PRUSS I/O  address range\n");
   182			ret = -ENOMEM;
   183			goto err_free_ddr_vaddr;
   184		}
   185	
   186		gdev->pintc_base = pdata->pintc_base;
   187		gdev->hostirq_start = platform_get_irq(pdev, 0);
   188	
   189		for (cnt = 0, p = gdev->info; cnt < MAX_PRUSS_EVT; cnt++, p++) {
   190			p->mem[0].addr = regs_prussio->start;
   191			p->mem[0].size = resource_size(regs_prussio);
   192			p->mem[0].memtype = UIO_MEM_PHYS;
   193	
   194			p->mem[1].addr = gdev->sram_paddr;
   195			p->mem[1].size = sram_pool_sz;
   196			p->mem[1].memtype = UIO_MEM_PHYS;
   197	
   198			p->mem[2].addr = gdev->ddr_paddr;
   199			p->mem[2].size = extram_pool_sz;
   200			p->mem[2].memtype = UIO_MEM_PHYS;
   201	
   202			p->name = devm_kasprintf(dev, GFP_KERNEL, "pruss_evt%d", cnt);
   203			p->version = DRV_VERSION;
   204	
   205			/* Register PRUSS IRQ lines */
   206			p->irq = gdev->hostirq_start + cnt;
   207			p->handler = pruss_handler;
   208			p->priv = gdev;
   209	
   210			ret = uio_register_device(dev, p);
   211			if (ret < 0)
   212				goto err_unloop;
   213		}
   214	
   215		platform_set_drvdata(pdev, gdev);
   216		return 0;
   217	
   218	err_unloop:
   219		for (i = 0, p = gdev->info; i < cnt; i++, p++) {
   220			uio_unregister_device(p);
   221		}
   222		iounmap(gdev->prussio_vaddr);
   223	err_free_ddr_vaddr:
   224		dma_free_coherent(dev, extram_pool_sz, gdev->ddr_vaddr,
   225				  gdev->ddr_paddr);
   226	err_free_sram:
   227		if (pdata->sram_pool)
   228			gen_pool_free(gdev->sram_pool, gdev->sram_vaddr, sram_pool_sz);
   229	err_clk_disable:
   230		clk_disable(gdev->pruss_clk);
   231	
   232		return ret;
   233	}
   234	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (29223 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ