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: <5f2ddbf7-381a-870e-e533-5261bbc9337b@microchip.com>
Date:   Fri, 11 Feb 2022 08:30:48 +0000
From:   <Tudor.Ambarus@...rochip.com>
To:     <dan.carpenter@...cle.com>, <kbuild@...ts.01.org>
CC:     <lkp@...el.com>, <kbuild-all@...ts.01.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [ambarus:spi-nor/next 1/15] drivers/spi/atmel-quadspi.c:1202
 atmel_qspi_dma_init() warn: passing zero to 'PTR_ERR'

On 2/11/22 10:04, Dan Carpenter wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> tree:   https://github.com/ambarus/linux-0day spi-nor/next
> head:   038b3fa2d89f1a00fdb8767704cdb799a0fe746b
> commit: ff51c966a3c5144ae964797349747e680ee47c3a [1/15] spi: atmel-quadspi: Add support for sama7g5 QSPI
> config: openrisc-randconfig-m031-20220210 (https://download.01.org/0day-ci/archive/20220211/202202110830.1OGwXRWt-lkp@intel.com/config)
> compiler: or1k-linux-gcc (GCC) 11.2.0
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> 
> smatch warnings:
> drivers/spi/atmel-quadspi.c:1202 atmel_qspi_dma_init() warn: passing zero to 'PTR_ERR'
> 
> vim +/PTR_ERR +1202 drivers/spi/atmel-quadspi.c
> 
> ff51c966a3c514 drivers/spi/atmel-quadspi.c         Tudor Ambarus   2020-10-19  1194  static int atmel_qspi_dma_init(struct spi_controller *ctrl)
> ff51c966a3c514 drivers/spi/atmel-quadspi.c         Tudor Ambarus   2020-10-19  1195  {
> ff51c966a3c514 drivers/spi/atmel-quadspi.c         Tudor Ambarus   2020-10-19  1196     struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
> ff51c966a3c514 drivers/spi/atmel-quadspi.c         Tudor Ambarus   2020-10-19  1197     int ret;
> ff51c966a3c514 drivers/spi/atmel-quadspi.c         Tudor Ambarus   2020-10-19  1198
> ff51c966a3c514 drivers/spi/atmel-quadspi.c         Tudor Ambarus   2020-10-19  1199     aq->rx_chan = dma_request_chan(&aq->pdev->dev, "rx");
> ff51c966a3c514 drivers/spi/atmel-quadspi.c         Tudor Ambarus   2020-10-19  1200     if (IS_ERR(aq->rx_chan)) {
> ff51c966a3c514 drivers/spi/atmel-quadspi.c         Tudor Ambarus   2020-10-19  1201             aq->rx_chan = NULL;
> 
> Need to preserve the error code before setting this to NULL
> 
> ff51c966a3c514 drivers/spi/atmel-quadspi.c         Tudor Ambarus   2020-10-19 @1202             return dev_err_probe(&aq->pdev->dev, PTR_ERR(aq->rx_chan),
> ff51c966a3c514 drivers/spi/atmel-quadspi.c         Tudor Ambarus   2020-10-19  1203                                  "RX DMA channel is not available\n");
> 
> This will return success.
> 

Indeed, thanks! This is a personal development branch, I'll fix it inline since
the patch that adds support for this has not been integrated in mainline yet.
I'm not sure if I have to add the Reported-by tags or how to give credit to
a bug spotted on a patch that has not yet landed in mainline. Maybe by adding
a comment in the comments section of the patch "---"?

Cheers,
ta

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ