0 day kernel build service
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: drivers/platform/x86/toshiba_bluetooth.c:261 toshiba_bt_rfkill_probe() warn: 'bt_dev->rfk' is an error pointer or valid
Date: Sat, 12 Sep 2026 15:01:05 +0200	[thread overview]
Message-ID: <202609121412.Fe6ylN72-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: "Rafael J. Wysocki" <rjw@rjwysocki.net>
CC: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5225b8eec4c9bb21aecff6295fab6346a3c3738e
commit: 553b2ac59fbb434330287fde0cabc64bc6f11ceb platform/x86: toshiba_bluetooth: Convert ACPI driver to a platform one
date:   6 months ago
:::::: branch date: 14 hours ago
:::::: commit date: 6 months ago
config: i386-randconfig-141-20260911 (https://download.01.org/0day-ci/archive/20260912/202609121412.Fe6ylN72-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
smatch: v0.5.0-9187-g5189e3fb

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
| Fixes: 553b2ac59fbb ("platform/x86: toshiba_bluetooth: Convert ACPI driver to a platform one")
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202609121412.Fe6ylN72-lkp@intel.com/

smatch warnings:
drivers/platform/x86/toshiba_bluetooth.c:261 toshiba_bt_rfkill_probe() warn: 'bt_dev->rfk' is an error pointer or valid

vim +261 drivers/platform/x86/toshiba_bluetooth.c

42b4e9ee3d1d3b Jes Sorensen      2009-12-16  230  
553b2ac59fbb43 Rafael J. Wysocki 2026-03-24  231  static int toshiba_bt_rfkill_probe(struct platform_device *pdev)
42b4e9ee3d1d3b Jes Sorensen      2009-12-16  232  {
553b2ac59fbb43 Rafael J. Wysocki 2026-03-24  233  	struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
84c0691e514539 Azael Avalos      2015-05-03  234  	struct toshiba_bluetooth_dev *bt_dev;
18b8696b66d790 Azael Avalos      2015-03-26  235  	int result;
42b4e9ee3d1d3b Jes Sorensen      2009-12-16  236  
18b8696b66d790 Azael Avalos      2015-03-26  237  	result = toshiba_bluetooth_present(device->handle);
18b8696b66d790 Azael Avalos      2015-03-26  238  	if (result)
18b8696b66d790 Azael Avalos      2015-03-26  239  		return result;
18b8696b66d790 Azael Avalos      2015-03-26  240  
18b8696b66d790 Azael Avalos      2015-03-26  241  	pr_info("Toshiba ACPI Bluetooth device driver\n");
42b4e9ee3d1d3b Jes Sorensen      2009-12-16  242  
bf4afc53b77aea Linus Torvalds    2026-02-21  243  	bt_dev = kzalloc_obj(*bt_dev);
84c0691e514539 Azael Avalos      2015-05-03  244  	if (!bt_dev)
84c0691e514539 Azael Avalos      2015-05-03  245  		return -ENOMEM;
84c0691e514539 Azael Avalos      2015-05-03  246  	bt_dev->acpi_dev = device;
553b2ac59fbb43 Rafael J. Wysocki 2026-03-24  247  
553b2ac59fbb43 Rafael J. Wysocki 2026-03-24  248  	platform_set_drvdata(pdev, bt_dev);
84c0691e514539 Azael Avalos      2015-05-03  249  
84c0691e514539 Azael Avalos      2015-05-03  250  	result = toshiba_bluetooth_sync_status(bt_dev);
84c0691e514539 Azael Avalos      2015-05-03  251  	if (result) {
84c0691e514539 Azael Avalos      2015-05-03  252  		kfree(bt_dev);
84c0691e514539 Azael Avalos      2015-05-03  253  		return result;
84c0691e514539 Azael Avalos      2015-05-03  254  	}
84c0691e514539 Azael Avalos      2015-05-03  255  
7ee8cd3319d5e5 Azael Avalos      2015-05-03  256  	bt_dev->rfk = rfkill_alloc("Toshiba Bluetooth",
553b2ac59fbb43 Rafael J. Wysocki 2026-03-24  257  				   &pdev->dev,
7ee8cd3319d5e5 Azael Avalos      2015-05-03  258  				   RFKILL_TYPE_BLUETOOTH,
7ee8cd3319d5e5 Azael Avalos      2015-05-03  259  				   &rfk_ops,
7ee8cd3319d5e5 Azael Avalos      2015-05-03  260  				   bt_dev);
7ee8cd3319d5e5 Azael Avalos      2015-05-03 @261  	if (!bt_dev->rfk) {
7ee8cd3319d5e5 Azael Avalos      2015-05-03  262  		pr_err("Unable to allocate rfkill device\n");
4315abf3383010 Rafael J. Wysocki 2026-03-24  263  		result = -ENOMEM;
4315abf3383010 Rafael J. Wysocki 2026-03-24  264  		goto err_free_bt_dev;
7ee8cd3319d5e5 Azael Avalos      2015-05-03  265  	}
7ee8cd3319d5e5 Azael Avalos      2015-05-03  266  
7ee8cd3319d5e5 Azael Avalos      2015-05-03  267  	rfkill_set_hw_state(bt_dev->rfk, !bt_dev->killswitch);
7ee8cd3319d5e5 Azael Avalos      2015-05-03  268  
7ee8cd3319d5e5 Azael Avalos      2015-05-03  269  	result = rfkill_register(bt_dev->rfk);
7ee8cd3319d5e5 Azael Avalos      2015-05-03  270  	if (result) {
7ee8cd3319d5e5 Azael Avalos      2015-05-03  271  		pr_err("Unable to register rfkill device\n");
4315abf3383010 Rafael J. Wysocki 2026-03-24  272  		goto err_rfkill_destroy;
7ee8cd3319d5e5 Azael Avalos      2015-05-03  273  	}
42b4e9ee3d1d3b Jes Sorensen      2009-12-16  274  
4315abf3383010 Rafael J. Wysocki 2026-03-24  275  	result = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
4315abf3383010 Rafael J. Wysocki 2026-03-24  276  						 toshiba_bt_rfkill_notify, bt_dev);
4315abf3383010 Rafael J. Wysocki 2026-03-24  277  	if (result) {
4315abf3383010 Rafael J. Wysocki 2026-03-24  278  		pr_err("Unable to register ACPI notify handler\n");
4315abf3383010 Rafael J. Wysocki 2026-03-24  279  		goto err_rfkill_unregister;
4315abf3383010 Rafael J. Wysocki 2026-03-24  280  	}
4315abf3383010 Rafael J. Wysocki 2026-03-24  281  
4315abf3383010 Rafael J. Wysocki 2026-03-24  282  	return 0;
4315abf3383010 Rafael J. Wysocki 2026-03-24  283  
4315abf3383010 Rafael J. Wysocki 2026-03-24  284  err_rfkill_unregister:
4315abf3383010 Rafael J. Wysocki 2026-03-24  285  	rfkill_unregister(bt_dev->rfk);
4315abf3383010 Rafael J. Wysocki 2026-03-24  286  err_rfkill_destroy:
4315abf3383010 Rafael J. Wysocki 2026-03-24  287  	rfkill_destroy(bt_dev->rfk);
4315abf3383010 Rafael J. Wysocki 2026-03-24  288  err_free_bt_dev:
4315abf3383010 Rafael J. Wysocki 2026-03-24  289  	kfree(bt_dev);
42b4e9ee3d1d3b Jes Sorensen      2009-12-16  290  	return result;
42b4e9ee3d1d3b Jes Sorensen      2009-12-16  291  }
42b4e9ee3d1d3b Jes Sorensen      2009-12-16  292  

:::::: The code at line 261 was first introduced by commit
:::::: 7ee8cd3319d5e57b1b5e2b348f078af44e67a577 toshiba_bluetooth: Add RFKill handler functions

:::::: TO: Azael Avalos <coproscefalo@gmail.com>
:::::: CC: Darren Hart <dvhart@linux.intel.com>

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

             reply	other threads:[~2026-09-12 13:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12 13:01 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-05-24 20:54 drivers/platform/x86/toshiba_bluetooth.c:261 toshiba_bt_rfkill_probe() warn: 'bt_dev->rfk' is an error pointer or valid kernel test robot

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=202609121412.Fe6ylN72-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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