All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] staging: gdm724x: Fix DMA from stack
Date: Wed, 10 Feb 2021 01:22:14 +0800	[thread overview]
Message-ID: <202102100147.VAR5aXG9-lkp@intel.com> (raw)
In-Reply-To: <20210209145415.29609-1-ameynarkhede03@gmail.com>

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

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/ameynarkhede03-gmail-com/staging-gdm724x-Fix-DMA-from-stack/20210209-225530
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 06b0c0dce88e2aa2f01343db0f26d214d7f264a0
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
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/d793f4f05736924fc2207a0f8c338115523930da
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review ameynarkhede03-gmail-com/staging-gdm724x-Fix-DMA-from-stack/20210209-225530
        git checkout d793f4f05736924fc2207a0f8c338115523930da
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:10,
                    from include/linux/list.h:9,
                    from include/linux/module.h:12,
                    from drivers/staging/gdm724x/gdm_usb.c:6:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:174:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     174 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
     137 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
     137 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/staging/gdm724x/gdm_usb.c: In function 'request_mac_address':
>> drivers/staging/gdm724x/gdm_usb.c:60:21: warning: 'buf' is used uninitialized in this function [-Wuninitialized]
      60 |  struct hci_packet *hci = (struct hci_packet *)buf;
         |                     ^~~


vim +/buf +60 drivers/staging/gdm724x/gdm_usb.c

61e12104764512 Won Kang       2013-07-25  50  
61e12104764512 Won Kang       2013-07-25  51  static int gdm_usb_recv(void *priv_dev,
35db0350c5ef0d Aybuke Ozdemir 2014-03-14  52  			int (*cb)(void *cb_data,
35db0350c5ef0d Aybuke Ozdemir 2014-03-14  53  				  void *data, int len, int context),
61e12104764512 Won Kang       2013-07-25  54  			void *cb_data,
61e12104764512 Won Kang       2013-07-25  55  			int context);
61e12104764512 Won Kang       2013-07-25  56  
61e12104764512 Won Kang       2013-07-25  57  static int request_mac_address(struct lte_udev *udev)
61e12104764512 Won Kang       2013-07-25  58  {
d793f4f0573692 Amey Narkhede  2021-02-09  59  	u8 *buf;
61e12104764512 Won Kang       2013-07-25 @60  	struct hci_packet *hci = (struct hci_packet *)buf;
61e12104764512 Won Kang       2013-07-25  61  	struct usb_device *usbdev = udev->usbdev;
61e12104764512 Won Kang       2013-07-25  62  	int actual;
61e12104764512 Won Kang       2013-07-25  63  	int ret = -1;
61e12104764512 Won Kang       2013-07-25  64  
1b5e56ece3f501 Quytelda Kahja 2018-02-22  65  	hci->cmd_evt = gdm_cpu_to_dev16(udev->gdm_ed, LTE_GET_INFORMATION);
1b5e56ece3f501 Quytelda Kahja 2018-02-22  66  	hci->len = gdm_cpu_to_dev16(udev->gdm_ed, 1);
61e12104764512 Won Kang       2013-07-25  67  	hci->data[0] = MAC_ADDRESS;
61e12104764512 Won Kang       2013-07-25  68  
d793f4f0573692 Amey Narkhede  2021-02-09  69  	buf = kmalloc(16, GFP_KERNEL);
d793f4f0573692 Amey Narkhede  2021-02-09  70  	if (!buf)
d793f4f0573692 Amey Narkhede  2021-02-09  71  		return -ENOMEM;
d793f4f0573692 Amey Narkhede  2021-02-09  72  
61e12104764512 Won Kang       2013-07-25  73  	ret = usb_bulk_msg(usbdev, usb_sndbulkpipe(usbdev, 2), buf, 5,
61e12104764512 Won Kang       2013-07-25  74  			   &actual, 1000);
61e12104764512 Won Kang       2013-07-25  75  
61e12104764512 Won Kang       2013-07-25  76  	udev->request_mac_addr = 1;
61e12104764512 Won Kang       2013-07-25  77  
61e12104764512 Won Kang       2013-07-25  78  	return ret;
61e12104764512 Won Kang       2013-07-25  79  }
61e12104764512 Won Kang       2013-07-25  80  

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 59644 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: ameynarkhede03@gmail.com, gregkh@linuxfoundation.org
Cc: kbuild-all@lists.01.org, devel@driverdev.osuosl.org,
	Amey Narkhede <ameynarkhede03@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: gdm724x: Fix DMA from stack
Date: Wed, 10 Feb 2021 01:22:14 +0800	[thread overview]
Message-ID: <202102100147.VAR5aXG9-lkp@intel.com> (raw)
In-Reply-To: <20210209145415.29609-1-ameynarkhede03@gmail.com>

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

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/ameynarkhede03-gmail-com/staging-gdm724x-Fix-DMA-from-stack/20210209-225530
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 06b0c0dce88e2aa2f01343db0f26d214d7f264a0
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
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/d793f4f05736924fc2207a0f8c338115523930da
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review ameynarkhede03-gmail-com/staging-gdm724x-Fix-DMA-from-stack/20210209-225530
        git checkout d793f4f05736924fc2207a0f8c338115523930da
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:10,
                    from include/linux/list.h:9,
                    from include/linux/module.h:12,
                    from drivers/staging/gdm724x/gdm_usb.c:6:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:174:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     174 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
     137 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
     137 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/staging/gdm724x/gdm_usb.c: In function 'request_mac_address':
>> drivers/staging/gdm724x/gdm_usb.c:60:21: warning: 'buf' is used uninitialized in this function [-Wuninitialized]
      60 |  struct hci_packet *hci = (struct hci_packet *)buf;
         |                     ^~~


vim +/buf +60 drivers/staging/gdm724x/gdm_usb.c

61e12104764512 Won Kang       2013-07-25  50  
61e12104764512 Won Kang       2013-07-25  51  static int gdm_usb_recv(void *priv_dev,
35db0350c5ef0d Aybuke Ozdemir 2014-03-14  52  			int (*cb)(void *cb_data,
35db0350c5ef0d Aybuke Ozdemir 2014-03-14  53  				  void *data, int len, int context),
61e12104764512 Won Kang       2013-07-25  54  			void *cb_data,
61e12104764512 Won Kang       2013-07-25  55  			int context);
61e12104764512 Won Kang       2013-07-25  56  
61e12104764512 Won Kang       2013-07-25  57  static int request_mac_address(struct lte_udev *udev)
61e12104764512 Won Kang       2013-07-25  58  {
d793f4f0573692 Amey Narkhede  2021-02-09  59  	u8 *buf;
61e12104764512 Won Kang       2013-07-25 @60  	struct hci_packet *hci = (struct hci_packet *)buf;
61e12104764512 Won Kang       2013-07-25  61  	struct usb_device *usbdev = udev->usbdev;
61e12104764512 Won Kang       2013-07-25  62  	int actual;
61e12104764512 Won Kang       2013-07-25  63  	int ret = -1;
61e12104764512 Won Kang       2013-07-25  64  
1b5e56ece3f501 Quytelda Kahja 2018-02-22  65  	hci->cmd_evt = gdm_cpu_to_dev16(udev->gdm_ed, LTE_GET_INFORMATION);
1b5e56ece3f501 Quytelda Kahja 2018-02-22  66  	hci->len = gdm_cpu_to_dev16(udev->gdm_ed, 1);
61e12104764512 Won Kang       2013-07-25  67  	hci->data[0] = MAC_ADDRESS;
61e12104764512 Won Kang       2013-07-25  68  
d793f4f0573692 Amey Narkhede  2021-02-09  69  	buf = kmalloc(16, GFP_KERNEL);
d793f4f0573692 Amey Narkhede  2021-02-09  70  	if (!buf)
d793f4f0573692 Amey Narkhede  2021-02-09  71  		return -ENOMEM;
d793f4f0573692 Amey Narkhede  2021-02-09  72  
61e12104764512 Won Kang       2013-07-25  73  	ret = usb_bulk_msg(usbdev, usb_sndbulkpipe(usbdev, 2), buf, 5,
61e12104764512 Won Kang       2013-07-25  74  			   &actual, 1000);
61e12104764512 Won Kang       2013-07-25  75  
61e12104764512 Won Kang       2013-07-25  76  	udev->request_mac_addr = 1;
61e12104764512 Won Kang       2013-07-25  77  
61e12104764512 Won Kang       2013-07-25  78  	return ret;
61e12104764512 Won Kang       2013-07-25  79  }
61e12104764512 Won Kang       2013-07-25  80  

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 59644 bytes --]

  reply	other threads:[~2021-02-09 17:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 14:54 [PATCH] staging: gdm724x: Fix DMA from stack ameynarkhede03
2021-02-09 17:22 ` kernel test robot [this message]
2021-02-09 17:22   ` kernel test robot
2021-02-09 17:40 ` Greg KH
2021-02-09 19:35   ` Amey Narkhede
2021-02-09 18:19 ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202102100147.VAR5aXG9-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.