Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Wentao Liang <vulab@iscas.ac.cn>,
	marcel@holtmann.org, luiz.dentz@gmail.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	Wentao Liang <vulab@iscas.ac.cn>,
	stable@vger.kernel.org
Subject: Re: [PATCH] btmrvl: Fix hdev dangling pointer and error code in register_hdev
Date: Sun, 9 Aug 2026 05:05:53 +0800	[thread overview]
Message-ID: <202608090403.IZoIz1yQ-lkp@intel.com> (raw)
In-Reply-To: <20260625160607.81615-1-vulab@iscas.ac.cn>

Hi Wentao,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on bluetooth/master linus/master v7.2-rc6 next-20260807]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Wentao-Liang/btmrvl-Fix-hdev-dangling-pointer-and-error-code-in-register_hdev/20260808-022129
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
patch link:    https://lore.kernel.org/r/20260625160607.81615-1-vulab%40iscas.ac.cn
patch subject: [PATCH] btmrvl: Fix hdev dangling pointer and error code in register_hdev
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20260809/202608090403.IZoIz1yQ-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 12df34b8469b8095359de8c249cb1b2753fadeea)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260809/202608090403.IZoIz1yQ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608090403.IZoIz1yQ-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/bluetooth/btmrvl_main.c:685:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     685 |         if (!hdev) {
         |             ^~~~~
   drivers/bluetooth/btmrvl_main.c:726:9: note: uninitialized use occurs here
     726 |         return ret;
         |                ^~~
   drivers/bluetooth/btmrvl_main.c:685:2: note: remove the 'if' if its condition is always false
     685 |         if (!hdev) {
         |         ^~~~~~~~~~~~
     686 |                 BT_ERR("Can not allocate HCI device");
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     687 |                 goto err_hdev;
         |                 ~~~~~~~~~~~~~~
     688 |         }
         |         ~
   drivers/bluetooth/btmrvl_main.c:682:9: note: initialize the variable 'ret' to silence this warning
     682 |         int ret;
         |                ^
         |                 = 0
   1 warning generated.


vim +685 drivers/bluetooth/btmrvl_main.c

132ff4e5fa8dfb Bing Zhao              2009-06-02  677  
64061607eab7cb Bing Zhao              2010-03-03  678  int btmrvl_register_hdev(struct btmrvl_private *priv)
132ff4e5fa8dfb Bing Zhao              2009-06-02  679  {
132ff4e5fa8dfb Bing Zhao              2009-06-02  680  	struct hci_dev *hdev = NULL;
70a7808b50b119 Abhishek Pandit-Subedi 2020-06-10  681  	struct btmrvl_sdio_card *card = priv->btmrvl_dev.card;
132ff4e5fa8dfb Bing Zhao              2009-06-02  682  	int ret;
132ff4e5fa8dfb Bing Zhao              2009-06-02  683  
132ff4e5fa8dfb Bing Zhao              2009-06-02  684  	hdev = hci_alloc_dev();
132ff4e5fa8dfb Bing Zhao              2009-06-02 @685  	if (!hdev) {
132ff4e5fa8dfb Bing Zhao              2009-06-02  686  		BT_ERR("Can not allocate HCI device");
132ff4e5fa8dfb Bing Zhao              2009-06-02  687  		goto err_hdev;
132ff4e5fa8dfb Bing Zhao              2009-06-02  688  	}
132ff4e5fa8dfb Bing Zhao              2009-06-02  689  
132ff4e5fa8dfb Bing Zhao              2009-06-02  690  	priv->btmrvl_dev.hcidev = hdev;
155961e8001719 David Rheinsberg       2012-02-09  691  	hci_set_drvdata(hdev, priv);
132ff4e5fa8dfb Bing Zhao              2009-06-02  692  
c13854cef47510 Marcel Holtmann        2010-02-08  693  	hdev->bus   = HCI_SDIO;
132ff4e5fa8dfb Bing Zhao              2009-06-02  694  	hdev->open  = btmrvl_open;
132ff4e5fa8dfb Bing Zhao              2009-06-02  695  	hdev->close = btmrvl_close;
132ff4e5fa8dfb Bing Zhao              2009-06-02  696  	hdev->flush = btmrvl_flush;
132ff4e5fa8dfb Bing Zhao              2009-06-02  697  	hdev->send  = btmrvl_send_frame;
4b245722cabc6e Amitkumar Karwar       2013-10-01  698  	hdev->setup = btmrvl_setup;
27b869f59d5d98 Amitkumar Karwar       2014-07-18  699  	hdev->set_bdaddr = btmrvl_set_bdaddr;
4539ca67fe8ede Luiz Augusto von Dentz 2021-10-01  700  	hdev->wakeup = btmrvl_wakeup;
70a7808b50b119 Abhishek Pandit-Subedi 2020-06-10  701  	SET_HCIDEV_DEV(hdev, &card->func->dev);
64061607eab7cb Bing Zhao              2010-03-03  702  
132ff4e5fa8dfb Bing Zhao              2009-06-02  703  	ret = hci_register_dev(hdev);
132ff4e5fa8dfb Bing Zhao              2009-06-02  704  	if (ret < 0) {
132ff4e5fa8dfb Bing Zhao              2009-06-02  705  		BT_ERR("Can not register HCI device");
b10393b3962ee8 Wentao Liang           2026-06-26  706  		goto err_hci_register_dev_free;
132ff4e5fa8dfb Bing Zhao              2009-06-02  707  	}
132ff4e5fa8dfb Bing Zhao              2009-06-02  708  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

           reply	other threads:[~2026-08-08 21:06 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20260625160607.81615-1-vulab@iscas.ac.cn>]

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=202608090403.IZoIz1yQ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=vulab@iscas.ac.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox