CC: [email protected]
BCC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Luiz Augusto von Dentz <[email protected]>
TO: [email protected]

Hi Luiz,

I love your patch! Perhaps something to improve:

[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on bluetooth/master v5.18-rc6 next-20220511]
[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/intel-lab-lkp/linux/commits/Luiz-Augusto-von-Dentz/Bluetooth-eir-Add-helpers-for-managing-service-data/20220507-060014
base:   
https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
master
:::::: branch date: 5 days ago
:::::: commit date: 5 days ago
config: csky-randconfig-m031-20220508 
(https://download.01.org/0day-ci/archive/20220512/[email protected]/config)
compiler: csky-linux-gcc (GCC) 11.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

New smatch warnings:
net/bluetooth/hci_sync.c:1110 hci_start_per_adv_sync() warn: passing zero to 
'PTR_ERR'

Old smatch warnings:
net/bluetooth/hci_sync.c:195 __hci_cmd_sync_sk() error: (-2147483647) too low 
for ERR_PTR
net/bluetooth/hci_sync.c:2027 hci_resume_advertising_sync() error: 
uninitialized symbol 'err'.

vim +/PTR_ERR +1110 net/bluetooth/hci_sync.c

2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1090  
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1091  int 
hci_start_per_adv_sync(struct hci_dev *hdev, u8 instance, u8 data_len,
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1092                          
   u8 *data, u32 flags, u16 min_interval,
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1093                          
   u16 max_interval, u16 sync_interval)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1094  {
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1095          struct adv_info 
*adv = NULL;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1096          int err;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1097          bool added = 
false;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1098  
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1099          
hci_disable_per_advertising_sync(hdev, instance);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1100  
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1101          if (instance) {
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1102                  adv = 
hci_find_adv_instance(hdev, instance);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1103                  /* 
Create an instance if that could not be found */
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1104                  if 
(!adv) {
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1105                          
adv = hci_add_per_instance(hdev, instance, flags,
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1106                          
                           data_len, data,
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1107                          
                           sync_interval,
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1108                          
                           sync_interval);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1109                          
if (IS_ERR_OR_NULL(adv))
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 @1110                          
        return PTR_ERR(adv);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1111                          
added = true;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1112                  }
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1113          }
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1114  
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1115          /* Only start 
advertising if instance 0 or if a dedicated instance has
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1116           * been added.
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1117           */
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1118          if (!adv || 
added) {
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1119                  err = 
hci_start_ext_adv_sync(hdev, instance);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1120                  if (err 
< 0)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1121                          
goto fail;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1122  
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1123                  err = 
hci_adv_bcast_annoucement(hdev, adv);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1124                  if (err 
< 0)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1125                          
goto fail;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1126          }
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1127  
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1128          err = 
hci_set_per_adv_params_sync(hdev, instance, min_interval,
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1129                          
                  max_interval);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1130          if (err < 0)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1131                  goto 
fail;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1132  
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1133          err = 
hci_set_per_adv_data_sync(hdev, instance);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1134          if (err < 0)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1135                  goto 
fail;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1136  
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1137          err = 
hci_enable_per_advertising_sync(hdev, instance);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1138          if (err < 0)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1139                  goto 
fail;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1140  
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1141          return 0;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1142  
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1143  fail:
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1144          if (added)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1145                  
hci_remove_adv_instance(hdev, instance);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1146  
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1147          return err;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1148  }
2f80269de71810 Luiz Augusto von Dentz 2022-05-06  1149  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to