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] [day] [month] [year] [list]
Message-ID: <202107290448.vu2HjxW7-lkp@intel.com>
Date:   Thu, 29 Jul 2021 04:38:41 +0800
From:   kernel test robot <lkp@...el.com>
To:     Pavel Skripkin <paskripkin@...il.com>, wg@...ndegger.com,
        mkl@...gutronix.de, davem@...emloft.net, socketcan@...tkopp.net,
        mailhol.vincent@...adoo.fr, Stefan.Maetje@....eu,
        matthias.fuchs@....eu
Cc:     clang-built-linux@...glegroups.com, kbuild-all@...ts.01.org,
        linux-can@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] can: esd_usb2: fix memory leak

Hi Pavel,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on mkl-can-next/testing]
[also build test ERROR on v5.14-rc3 next-20210727]
[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/Pavel-Skripkin/can-fix-same-memory-leaks-in-can-drivers/20210726-233224
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git testing
config: x86_64-randconfig-a012-20210728 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c49df15c278857adecd12db6bb1cdc96885f7079)
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
        # https://github.com/0day-ci/linux/commit/14373e3834eb74f943720146607c709613b93e95
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Pavel-Skripkin/can-fix-same-memory-leaks-in-can-drivers/20210726-233224
        git checkout 14373e3834eb74f943720146607c709613b93e95
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=x86_64 SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

>> drivers/net/can/usb/esd_usb2.c:582:9: error: use of undeclared label 'freeusrb'
                           goto freeusrb;
                                ^
   1 error generated.


vim +/freeusrb +582 drivers/net/can/usb/esd_usb2.c

   539	
   540	static int esd_usb2_setup_rx_urbs(struct esd_usb2 *dev)
   541	{
   542		int i, err = 0;
   543	
   544		if (dev->rxinitdone)
   545			return 0;
   546	
   547		for (i = 0; i < MAX_RX_URBS; i++) {
   548			struct urb *urb = NULL;
   549			u8 *buf = NULL;
   550			dma_addr_t buf_dma;
   551	
   552			/* create a URB, and a buffer for it */
   553			urb = usb_alloc_urb(0, GFP_KERNEL);
   554			if (!urb) {
   555				err = -ENOMEM;
   556				break;
   557			}
   558	
   559			buf = usb_alloc_coherent(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL,
   560						 &buf_dma);
   561			if (!buf) {
   562				dev_warn(dev->udev->dev.parent,
   563					 "No memory left for USB buffer\n");
   564				err = -ENOMEM;
   565				goto freeurb;
   566			}
   567	
   568			urb->transfer_dma = buf_dma;
   569	
   570			usb_fill_bulk_urb(urb, dev->udev,
   571					  usb_rcvbulkpipe(dev->udev, 1),
   572					  buf, RX_BUFFER_SIZE,
   573					  esd_usb2_read_bulk_callback, dev);
   574			urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
   575			usb_anchor_urb(urb, &dev->rx_submitted);
   576	
   577			err = usb_submit_urb(urb, GFP_KERNEL);
   578			if (err) {
   579				usb_unanchor_urb(urb);
   580				usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf,
   581						  urb->transfer_dma);
 > 582				goto freeusrb;
   583			}
   584	
   585			dev->rxbuf[i] = buf;
   586			dev->rxbuf_dma[i] = buf_dma;
   587	
   588	freeurb:
   589			/* Drop reference, USB core will take care of freeing it */
   590			usb_free_urb(urb);
   591			if (err)
   592				break;
   593		}
   594	
   595		/* Did we submit any URBs */
   596		if (i == 0) {
   597			dev_err(dev->udev->dev.parent, "couldn't setup read URBs\n");
   598			return err;
   599		}
   600	
   601		/* Warn if we've couldn't transmit all the URBs */
   602		if (i < MAX_RX_URBS) {
   603			dev_warn(dev->udev->dev.parent,
   604				 "rx performance may be slow\n");
   605		}
   606	
   607		dev->rxinitdone = 1;
   608		return 0;
   609	}
   610	

---
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" (43256 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ