All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 483/6579] net/bluetooth/mgmt.c:7476:2: warning: Assignment of function parameter has no effect outside the function. [uselessAssignmentArg]
@ 2021-12-11  5:21 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-12-11  5:21 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 10341 bytes --]

CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Brian Gix <brian.gix@intel.com>
CC: Marcel Holtmann <marcel@holtmann.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   ea922272cbe547bdf58da2aaf240d59782c6a009
commit: 177e77a30e469af96e301658facf6a12a6e9e200 [483/6579] Bluetooth: hci_sync: Convert MGMT_OP_READ_LOCAL_OOB_EXT_DATA
:::::: branch date: 8 hours ago
:::::: commit date: 6 weeks ago
compiler: sparc-linux-gcc (GCC) 11.2.0

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


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> net/bluetooth/mgmt.c:7476:2: warning: Assignment of function parameter has no effect outside the function. [uselessAssignmentArg]
    err = mgmt_limited_event(MGMT_EV_LOCAL_OOB_DATA_UPDATED, hdev,
    ^
   net/bluetooth/mgmt.c:7865:45: warning: Opposite expression on both sides of '&'. [oppositeExpression]
        ((phy_flags && (phy_flags ^ (phy_flags & -phy_flags)))))
                                               ^

vim +7476 net/bluetooth/mgmt.c

9713c17b086c1e Marcel Holtmann 2014-07-06  7366  
177e77a30e469a Brian Gix       2021-10-27  7367  static void read_local_oob_ext_data_complete(struct hci_dev *hdev, void *data,
177e77a30e469a Brian Gix       2021-10-27  7368  					     int err)
40f66c05c36077 Johan Hedberg   2015-04-07  7369  {
40f66c05c36077 Johan Hedberg   2015-04-07  7370  	const struct mgmt_cp_read_local_oob_ext_data *mgmt_cp;
40f66c05c36077 Johan Hedberg   2015-04-07  7371  	struct mgmt_rp_read_local_oob_ext_data *mgmt_rp;
40f66c05c36077 Johan Hedberg   2015-04-07  7372  	u8 *h192, *r192, *h256, *r256;
177e77a30e469a Brian Gix       2021-10-27  7373  	struct mgmt_pending_cmd *cmd = data;
177e77a30e469a Brian Gix       2021-10-27  7374  	struct sk_buff *skb = cmd->skb;
177e77a30e469a Brian Gix       2021-10-27  7375  	u8 status = mgmt_status(err);
40f66c05c36077 Johan Hedberg   2015-04-07  7376  	u16 eir_len;
40f66c05c36077 Johan Hedberg   2015-04-07  7377  
177e77a30e469a Brian Gix       2021-10-27  7378  	if (!status) {
177e77a30e469a Brian Gix       2021-10-27  7379  		if (!skb)
177e77a30e469a Brian Gix       2021-10-27  7380  			status = MGMT_STATUS_FAILED;
177e77a30e469a Brian Gix       2021-10-27  7381  		else if (IS_ERR(skb))
177e77a30e469a Brian Gix       2021-10-27  7382  			status = mgmt_status(PTR_ERR(skb));
177e77a30e469a Brian Gix       2021-10-27  7383  		else
177e77a30e469a Brian Gix       2021-10-27  7384  			status = mgmt_status(skb->data[0]);
177e77a30e469a Brian Gix       2021-10-27  7385  	}
40f66c05c36077 Johan Hedberg   2015-04-07  7386  
177e77a30e469a Brian Gix       2021-10-27  7387  	bt_dev_dbg(hdev, "status %u", status);
40f66c05c36077 Johan Hedberg   2015-04-07  7388  
40f66c05c36077 Johan Hedberg   2015-04-07  7389  	mgmt_cp = cmd->param;
40f66c05c36077 Johan Hedberg   2015-04-07  7390  
40f66c05c36077 Johan Hedberg   2015-04-07  7391  	if (status) {
40f66c05c36077 Johan Hedberg   2015-04-07  7392  		status = mgmt_status(status);
40f66c05c36077 Johan Hedberg   2015-04-07  7393  		eir_len = 0;
40f66c05c36077 Johan Hedberg   2015-04-07  7394  
40f66c05c36077 Johan Hedberg   2015-04-07  7395  		h192 = NULL;
40f66c05c36077 Johan Hedberg   2015-04-07  7396  		r192 = NULL;
40f66c05c36077 Johan Hedberg   2015-04-07  7397  		h256 = NULL;
40f66c05c36077 Johan Hedberg   2015-04-07  7398  		r256 = NULL;
177e77a30e469a Brian Gix       2021-10-27  7399  	} else if (!bredr_sc_enabled(hdev)) {
40f66c05c36077 Johan Hedberg   2015-04-07  7400  		struct hci_rp_read_local_oob_data *rp;
40f66c05c36077 Johan Hedberg   2015-04-07  7401  
40f66c05c36077 Johan Hedberg   2015-04-07  7402  		if (skb->len != sizeof(*rp)) {
40f66c05c36077 Johan Hedberg   2015-04-07  7403  			status = MGMT_STATUS_FAILED;
40f66c05c36077 Johan Hedberg   2015-04-07  7404  			eir_len = 0;
40f66c05c36077 Johan Hedberg   2015-04-07  7405  		} else {
40f66c05c36077 Johan Hedberg   2015-04-07  7406  			status = MGMT_STATUS_SUCCESS;
40f66c05c36077 Johan Hedberg   2015-04-07  7407  			rp = (void *)skb->data;
40f66c05c36077 Johan Hedberg   2015-04-07  7408  
40f66c05c36077 Johan Hedberg   2015-04-07  7409  			eir_len = 5 + 18 + 18;
40f66c05c36077 Johan Hedberg   2015-04-07  7410  			h192 = rp->hash;
40f66c05c36077 Johan Hedberg   2015-04-07  7411  			r192 = rp->rand;
40f66c05c36077 Johan Hedberg   2015-04-07  7412  			h256 = NULL;
40f66c05c36077 Johan Hedberg   2015-04-07  7413  			r256 = NULL;
40f66c05c36077 Johan Hedberg   2015-04-07  7414  		}
40f66c05c36077 Johan Hedberg   2015-04-07  7415  	} else {
40f66c05c36077 Johan Hedberg   2015-04-07  7416  		struct hci_rp_read_local_oob_ext_data *rp;
40f66c05c36077 Johan Hedberg   2015-04-07  7417  
40f66c05c36077 Johan Hedberg   2015-04-07  7418  		if (skb->len != sizeof(*rp)) {
40f66c05c36077 Johan Hedberg   2015-04-07  7419  			status = MGMT_STATUS_FAILED;
40f66c05c36077 Johan Hedberg   2015-04-07  7420  			eir_len = 0;
40f66c05c36077 Johan Hedberg   2015-04-07  7421  		} else {
40f66c05c36077 Johan Hedberg   2015-04-07  7422  			status = MGMT_STATUS_SUCCESS;
40f66c05c36077 Johan Hedberg   2015-04-07  7423  			rp = (void *)skb->data;
40f66c05c36077 Johan Hedberg   2015-04-07  7424  
40f66c05c36077 Johan Hedberg   2015-04-07  7425  			if (hci_dev_test_flag(hdev, HCI_SC_ONLY)) {
40f66c05c36077 Johan Hedberg   2015-04-07  7426  				eir_len = 5 + 18 + 18;
40f66c05c36077 Johan Hedberg   2015-04-07  7427  				h192 = NULL;
40f66c05c36077 Johan Hedberg   2015-04-07  7428  				r192 = NULL;
40f66c05c36077 Johan Hedberg   2015-04-07  7429  			} else {
40f66c05c36077 Johan Hedberg   2015-04-07  7430  				eir_len = 5 + 18 + 18 + 18 + 18;
40f66c05c36077 Johan Hedberg   2015-04-07  7431  				h192 = rp->hash192;
40f66c05c36077 Johan Hedberg   2015-04-07  7432  				r192 = rp->rand192;
40f66c05c36077 Johan Hedberg   2015-04-07  7433  			}
40f66c05c36077 Johan Hedberg   2015-04-07  7434  
40f66c05c36077 Johan Hedberg   2015-04-07  7435  			h256 = rp->hash256;
40f66c05c36077 Johan Hedberg   2015-04-07  7436  			r256 = rp->rand256;
40f66c05c36077 Johan Hedberg   2015-04-07  7437  		}
40f66c05c36077 Johan Hedberg   2015-04-07  7438  	}
40f66c05c36077 Johan Hedberg   2015-04-07  7439  
40f66c05c36077 Johan Hedberg   2015-04-07  7440  	mgmt_rp = kmalloc(sizeof(*mgmt_rp) + eir_len, GFP_KERNEL);
40f66c05c36077 Johan Hedberg   2015-04-07  7441  	if (!mgmt_rp)
40f66c05c36077 Johan Hedberg   2015-04-07  7442  		goto done;
40f66c05c36077 Johan Hedberg   2015-04-07  7443  
a31e5a4158d035 Kees Cook       2021-08-17  7444  	if (eir_len == 0)
40f66c05c36077 Johan Hedberg   2015-04-07  7445  		goto send_rsp;
40f66c05c36077 Johan Hedberg   2015-04-07  7446  
40f66c05c36077 Johan Hedberg   2015-04-07  7447  	eir_len = eir_append_data(mgmt_rp->eir, 0, EIR_CLASS_OF_DEV,
40f66c05c36077 Johan Hedberg   2015-04-07  7448  				  hdev->dev_class, 3);
40f66c05c36077 Johan Hedberg   2015-04-07  7449  
40f66c05c36077 Johan Hedberg   2015-04-07  7450  	if (h192 && r192) {
40f66c05c36077 Johan Hedberg   2015-04-07  7451  		eir_len = eir_append_data(mgmt_rp->eir, eir_len,
40f66c05c36077 Johan Hedberg   2015-04-07  7452  					  EIR_SSP_HASH_C192, h192, 16);
40f66c05c36077 Johan Hedberg   2015-04-07  7453  		eir_len = eir_append_data(mgmt_rp->eir, eir_len,
40f66c05c36077 Johan Hedberg   2015-04-07  7454  					  EIR_SSP_RAND_R192, r192, 16);
40f66c05c36077 Johan Hedberg   2015-04-07  7455  	}
40f66c05c36077 Johan Hedberg   2015-04-07  7456  
40f66c05c36077 Johan Hedberg   2015-04-07  7457  	if (h256 && r256) {
40f66c05c36077 Johan Hedberg   2015-04-07  7458  		eir_len = eir_append_data(mgmt_rp->eir, eir_len,
40f66c05c36077 Johan Hedberg   2015-04-07  7459  					  EIR_SSP_HASH_C256, h256, 16);
40f66c05c36077 Johan Hedberg   2015-04-07  7460  		eir_len = eir_append_data(mgmt_rp->eir, eir_len,
40f66c05c36077 Johan Hedberg   2015-04-07  7461  					  EIR_SSP_RAND_R256, r256, 16);
40f66c05c36077 Johan Hedberg   2015-04-07  7462  	}
40f66c05c36077 Johan Hedberg   2015-04-07  7463  
40f66c05c36077 Johan Hedberg   2015-04-07  7464  send_rsp:
40f66c05c36077 Johan Hedberg   2015-04-07  7465  	mgmt_rp->type = mgmt_cp->type;
40f66c05c36077 Johan Hedberg   2015-04-07  7466  	mgmt_rp->eir_len = cpu_to_le16(eir_len);
40f66c05c36077 Johan Hedberg   2015-04-07  7467  
40f66c05c36077 Johan Hedberg   2015-04-07  7468  	err = mgmt_cmd_complete(cmd->sk, hdev->id,
40f66c05c36077 Johan Hedberg   2015-04-07  7469  				MGMT_OP_READ_LOCAL_OOB_EXT_DATA, status,
40f66c05c36077 Johan Hedberg   2015-04-07  7470  				mgmt_rp, sizeof(*mgmt_rp) + eir_len);
40f66c05c36077 Johan Hedberg   2015-04-07  7471  	if (err < 0 || status)
40f66c05c36077 Johan Hedberg   2015-04-07  7472  		goto done;
40f66c05c36077 Johan Hedberg   2015-04-07  7473  
40f66c05c36077 Johan Hedberg   2015-04-07  7474  	hci_sock_set_flag(cmd->sk, HCI_MGMT_OOB_DATA_EVENTS);
40f66c05c36077 Johan Hedberg   2015-04-07  7475  
40f66c05c36077 Johan Hedberg   2015-04-07 @7476  	err = mgmt_limited_event(MGMT_EV_LOCAL_OOB_DATA_UPDATED, hdev,
40f66c05c36077 Johan Hedberg   2015-04-07  7477  				 mgmt_rp, sizeof(*mgmt_rp) + eir_len,
40f66c05c36077 Johan Hedberg   2015-04-07  7478  				 HCI_MGMT_OOB_DATA_EVENTS, cmd->sk);
40f66c05c36077 Johan Hedberg   2015-04-07  7479  done:
177e77a30e469a Brian Gix       2021-10-27  7480  	if (skb && !IS_ERR(skb))
177e77a30e469a Brian Gix       2021-10-27  7481  		kfree_skb(skb);
177e77a30e469a Brian Gix       2021-10-27  7482  
40f66c05c36077 Johan Hedberg   2015-04-07  7483  	kfree(mgmt_rp);
40f66c05c36077 Johan Hedberg   2015-04-07  7484  	mgmt_pending_remove(cmd);
40f66c05c36077 Johan Hedberg   2015-04-07  7485  }
40f66c05c36077 Johan Hedberg   2015-04-07  7486  

:::::: The code at line 7476 was first introduced by commit
:::::: 40f66c05c360777e847033ddbe076d88123719d1 Bluetooth: Add local SSP OOB data to OOB ext data mgmt command

:::::: TO: Johan Hedberg <johan.hedberg@intel.com>
:::::: CC: Marcel Holtmann <marcel@holtmann.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-11  5:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-11  5:21 [linux-next:master 483/6579] net/bluetooth/mgmt.c:7476:2: warning: Assignment of function parameter has no effect outside the function. [uselessAssignmentArg] kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.