net/bluetooth/hci_sync.c:2403 hci_pause_addr_resolution() warn: missing error code? 'err'
kernel test robot
build botBCC: [email protected]
CC: [email protected]
CC: Linux Memory Management List <[email protected]>
TO: Zhengping Jiang <[email protected]>
CC: Luiz Augusto von Dentz <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 8232539f864ca60474e38eb42d451f5c26415856 commit: 2b291083eb0c49cd1633cddf95cc0e6e7303e43b [13863/14003] Bluetooth: hci_sync: Resume adv with no RPA when active scan
:::::: branch date: 8 hours ago
:::::: commit date: 15 hours ago
config: parisc-randconfig-m031-20230223 (https://download.01.org/0day-ci/archive/20230225/[email protected]/config)
compiler: hppa-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]> | Reported-by: Dan Carpenter <[email protected]> | Link: https://lore.kernel.org/r/[email protected]/
New smatch warnings:net/bluetooth/hci_sync.c:2403 hci_pause_addr_resolution() warn: missing error code? 'err'
Old smatch warnings:net/bluetooth/hci_sync.c:2367 hci_resume_advertising_sync() error: uninitialized symbol 'err'.
vim +/err +2403 net/bluetooth/hci_sync.c
e8907f76544ffe Luiz Augusto von Dentz 2021-10-27 2369
2b291083eb0c49 Zhengping Jiang 2023-02-21 2370 static int hci_pause_addr_resolution(struct hci_dev *hdev)
2b291083eb0c49 Zhengping Jiang 2023-02-21 2371 {
2b291083eb0c49 Zhengping Jiang 2023-02-21 2372 int err;
2b291083eb0c49 Zhengping Jiang 2023-02-21 2373
2b291083eb0c49 Zhengping Jiang 2023-02-21 2374 if (!use_ll_privacy(hdev))
2b291083eb0c49 Zhengping Jiang 2023-02-21 2375 return 0;
2b291083eb0c49 Zhengping Jiang 2023-02-21 2376
2b291083eb0c49 Zhengping Jiang 2023-02-21 2377 if (!hci_dev_test_flag(hdev, HCI_LL_RPA_RESOLUTION))
2b291083eb0c49 Zhengping Jiang 2023-02-21 2378 return 0;
2b291083eb0c49 Zhengping Jiang 2023-02-21 2379
2b291083eb0c49 Zhengping Jiang 2023-02-21 2380 /* Cannot disable addr resolution if scanning is enabled or
2b291083eb0c49 Zhengping Jiang 2023-02-21 2381 * when initiating an LE connection.
2b291083eb0c49 Zhengping Jiang 2023-02-21 2382 */
2b291083eb0c49 Zhengping Jiang 2023-02-21 2383 if (hci_dev_test_flag(hdev, HCI_LE_SCAN) ||
2b291083eb0c49 Zhengping Jiang 2023-02-21 2384 hci_lookup_le_connect(hdev)) {
2b291083eb0c49 Zhengping Jiang 2023-02-21 2385 bt_dev_err(hdev, "Command not allowed when scan/LE connect");
2b291083eb0c49 Zhengping Jiang 2023-02-21 2386 return -EPERM;
2b291083eb0c49 Zhengping Jiang 2023-02-21 2387 }
2b291083eb0c49 Zhengping Jiang 2023-02-21 2388
2b291083eb0c49 Zhengping Jiang 2023-02-21 2389 /* Cannot disable addr resolution if advertising is enabled. */
2b291083eb0c49 Zhengping Jiang 2023-02-21 2390 err = hci_pause_advertising_sync(hdev);
2b291083eb0c49 Zhengping Jiang 2023-02-21 2391 if (err) {
2b291083eb0c49 Zhengping Jiang 2023-02-21 2392 bt_dev_err(hdev, "Pause advertising failed: %d", err);
2b291083eb0c49 Zhengping Jiang 2023-02-21 2393 return err;
2b291083eb0c49 Zhengping Jiang 2023-02-21 2394 }
2b291083eb0c49 Zhengping Jiang 2023-02-21 2395
2b291083eb0c49 Zhengping Jiang 2023-02-21 2396 err = hci_le_set_addr_resolution_enable_sync(hdev, 0x00);
2b291083eb0c49 Zhengping Jiang 2023-02-21 2397 if (err)
2b291083eb0c49 Zhengping Jiang 2023-02-21 2398 bt_dev_err(hdev, "Unable to disable Address Resolution: %d",
2b291083eb0c49 Zhengping Jiang 2023-02-21 2399 err);
2b291083eb0c49 Zhengping Jiang 2023-02-21 2400
2b291083eb0c49 Zhengping Jiang 2023-02-21 2401 /* Return if address resolution is disabled and RPA is not used. */
2b291083eb0c49 Zhengping Jiang 2023-02-21 2402 if (!err && scan_use_rpa(hdev))
2b291083eb0c49 Zhengping Jiang 2023-02-21 @2403 return err;
2b291083eb0c49 Zhengping Jiang 2023-02-21 2404
2b291083eb0c49 Zhengping Jiang 2023-02-21 2405 hci_resume_advertising_sync(hdev);
2b291083eb0c49 Zhengping Jiang 2023-02-21 2406 return err;
2b291083eb0c49 Zhengping Jiang 2023-02-21 2407 }
2b291083eb0c49 Zhengping Jiang 2023-02-21 2408 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests