From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [android-common:android14-6.1 4/4] net/bluetooth/hci_conn.c:1807:7-14: WARNING opportunity for kmemdup
Date: Wed, 23 Sep 2026 23:44:18 +0200 [thread overview]
Message-ID: <202609232327.ztAxhH6f-lkp@intel.com> (raw)
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
reply other threads:[~2026-09-23 21:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202609232327.ztAxhH6f-lkp@intel.com \
--to=lkp@intel.com \
--cc=cros-kernel-buildreports@googlegroups.com \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.