All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android14-6.1 4/4] net/bluetooth/hci_conn.c:1807:7-14: WARNING opportunity for kmemdup
@ 2026-09-23 21:44 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-23 21:44 UTC (permalink / raw)
  To: cros-kernel-buildreports; +Cc: oe-kbuild-all

tree:   https://android.googlesource.com/kernel/common android14-6.1
head:   f26a1f4f9013533dd2b0de85e6813f948363a4ff
commit: 4aa515393f02f69cb33121f8aac9078c6c925297 [4/4] Bluetooth: ISO: use hci_sync for setting CIG parameters
config: i386-randconfig-2103-20260923 (https://download.01.org/0day-ci/archive/20260923/202609232327.ztAxhH6f-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0

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
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609232327.ztAxhH6f-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> net/bluetooth/hci_conn.c:1807:7-14: WARNING opportunity for kmemdup

vim +1807 net/bluetooth/hci_conn.c

  1731	
  1732	static bool hci_le_set_cig_params(struct hci_conn *conn, struct bt_iso_qos *qos)
  1733	{
  1734		struct hci_dev *hdev = conn->hdev;
  1735		struct iso_list_data data;
  1736		struct iso_cig_params *pdu;
  1737	
  1738		memset(&data, 0, sizeof(data));
  1739	
  1740		/* Allocate a CIG if not set */
  1741		if (qos->cig == BT_ISO_QOS_CIG_UNSET) {
  1742			for (data.cig = 0x00; data.cig < 0xff; data.cig++) {
  1743				data.count = 0;
  1744				data.cis = 0xff;
  1745	
  1746				hci_conn_hash_list_state(hdev, cis_list, ISO_LINK,
  1747							 BT_BOUND, &data);
  1748				if (data.count)
  1749					continue;
  1750	
  1751				hci_conn_hash_list_state(hdev, cis_list, ISO_LINK,
  1752							 BT_CONNECTED, &data);
  1753				if (!data.count)
  1754					break;
  1755			}
  1756	
  1757			if (data.cig == 0xff)
  1758				return false;
  1759	
  1760			/* Update CIG */
  1761			qos->cig = data.cig;
  1762		}
  1763	
  1764		data.pdu.cp.cig_id = qos->cig;
  1765		hci_cpu_to_le24(qos->out.interval, data.pdu.cp.c_interval);
  1766		hci_cpu_to_le24(qos->in.interval, data.pdu.cp.p_interval);
  1767		data.pdu.cp.sca = qos->sca;
  1768		data.pdu.cp.packing = qos->packing;
  1769		data.pdu.cp.framing = qos->framing;
  1770		data.pdu.cp.c_latency = cpu_to_le16(qos->out.latency);
  1771		data.pdu.cp.p_latency = cpu_to_le16(qos->in.latency);
  1772	
  1773		if (qos->cis != BT_ISO_QOS_CIS_UNSET) {
  1774			data.count = 0;
  1775			data.cig = qos->cig;
  1776			data.cis = qos->cis;
  1777	
  1778			hci_conn_hash_list_state(hdev, cis_list, ISO_LINK, BT_BOUND,
  1779						 &data);
  1780			if (data.count)
  1781				return false;
  1782	
  1783			cis_add(&data, qos);
  1784		}
  1785	
  1786		/* Reprogram all CIS(s) with the same CIG */
  1787		for (data.cig = qos->cig, data.cis = 0x00; data.cis < 0x11;
  1788		     data.cis++) {
  1789			data.count = 0;
  1790	
  1791			hci_conn_hash_list_state(hdev, cis_list, ISO_LINK, BT_BOUND,
  1792						 &data);
  1793			if (data.count)
  1794				continue;
  1795	
  1796			/* Allocate a CIS if not set */
  1797			if (qos->cis == BT_ISO_QOS_CIS_UNSET) {
  1798				/* Update CIS */
  1799				qos->cis = data.cis;
  1800				cis_add(&data, qos);
  1801			}
  1802		}
  1803	
  1804		if (qos->cis == BT_ISO_QOS_CIS_UNSET || !data.pdu.cp.num_cis)
  1805			return false;
  1806	
> 1807		pdu = kzalloc(sizeof(*pdu), GFP_KERNEL);
  1808		if (!pdu)
  1809			return false;
  1810	
  1811		memcpy(pdu, &data.pdu, sizeof(*pdu));
  1812	
  1813		if (hci_cmd_sync_queue(hdev, set_cig_params_sync, pdu,
  1814				       set_cig_params_complete) < 0) {
  1815			kfree(pdu);
  1816			return false;
  1817		}
  1818	
  1819		return true;
  1820	}
  1821	

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

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

only message in thread, other threads:[~2026-09-23 21:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-23 21:44 [android-common:android14-6.1 4/4] net/bluetooth/hci_conn.c:1807:7-14: WARNING opportunity for kmemdup 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.