Re: [PATCH 6/8] Bluetooth: ISO: Add broadcast support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-rc5 next-20220505]
[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/20220506-070828
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: x86_64-randconfig-a013 (https://download.01.org/0day-ci/archive/20220506/202205061022.2EG8sVaE-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.2.0-20) 11.2.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/c9952abdb0e8adbeadc722ce26b2ee5a64244860
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Luiz-Augusto-von-Dentz/Bluetooth-eir-Add-helpers-for-managing-service-data/20220506-070828
        git checkout c9952abdb0e8adbeadc722ce26b2ee5a64244860
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash net/bluetooth/

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

All warnings (new ones prefixed by >>):

   net/bluetooth/iso.c: In function 'iso_sock_getsockopt':
>> net/bluetooth/iso.c:1214:13: warning: variable 'base' set but not used [-Wunused-but-set-variable]
    1214 |         u8 *base;
         |             ^~~~


vim +/base +1214 net/bluetooth/iso.c

  1206	
  1207	static int iso_sock_getsockopt(struct socket *sock, int level, int optname,
  1208				       char __user *optval, int __user *optlen)
  1209	{
  1210		struct sock *sk = sock->sk;
  1211		int len, err = 0;
  1212		struct bt_iso_qos qos;
  1213		u8 base_len;
> 1214		u8 *base;
  1215	
  1216		BT_DBG("sk %p", sk);
  1217	
  1218		if (get_user(len, optlen))
  1219			return -EFAULT;
  1220	
  1221		lock_sock(sk);
  1222	
  1223		switch (optname) {
  1224	
  1225		case BT_DEFER_SETUP:
  1226			if (sk->sk_state != BT_BOUND && sk->sk_state != BT_LISTEN) {
  1227				err = -EINVAL;
  1228				break;
  1229			}
  1230	
  1231			if (put_user(test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags),
  1232				     (u32 __user *)optval))
  1233				err = -EFAULT;
  1234	
  1235			break;
  1236	
  1237		case BT_ISO_QOS:
  1238			if (sk->sk_state == BT_CONNECTED)
  1239				qos = iso_pi(sk)->conn->hcon->iso_qos;
  1240			else
  1241				qos = iso_pi(sk)->qos;
  1242	
  1243			len = min_t(unsigned int, len, sizeof(qos));
  1244			if (copy_to_user(optval, (char *)&qos, len))
  1245				err = -EFAULT;
  1246	
  1247			break;
  1248	
  1249		case BT_ISO_BASE:
  1250			if (sk->sk_state == BT_CONNECTED) {
  1251				base_len = iso_pi(sk)->conn->hcon->le_per_adv_data_len;
  1252				base = iso_pi(sk)->conn->hcon->le_per_adv_data;
  1253			} else {
  1254				base_len = iso_pi(sk)->base_len;
  1255				base = iso_pi(sk)->base;
  1256			}
  1257	
  1258			len = min_t(unsigned int, len, base_len);
  1259			if (copy_to_user(optval, (char *)&qos, len))
  1260				err = -EFAULT;
  1261	
  1262			break;
  1263	
  1264		default:
  1265			err = -ENOPROTOOPT;
  1266			break;
  1267		}
  1268	
  1269		release_sock(sk);
  1270		return err;
  1271	}
  1272	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux