diff options
author | Yihao Han <hanyihao@vivo.com> | 2022-09-20 05:19:58 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-09-21 00:31:57 +0200 |
commit | bb20da18ce936adda6b48aea79a8797c8eee479f (patch) | |
tree | be09c4d8f37b180dc612b0c1e07ace47a6ec0d0a /net/bluetooth | |
parent | Bluetooth: hci_{ldisc,serdev}: check percpu_init_rwsem() failure (diff) | |
download | linux-bb20da18ce936adda6b48aea79a8797c8eee479f.tar.xz linux-bb20da18ce936adda6b48aea79a8797c8eee479f.zip |
Bluetooth: MGMT: fix zalloc-simple.cocci warnings
Use zeroing allocator rather than allocator followed by memset with 0
Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci
Signed-off-by: Yihao Han <hanyihao@vivo.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index b9b64030a7b0..a92e7e485feb 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -4397,12 +4397,10 @@ static int read_exp_features_info(struct sock *sk, struct hci_dev *hdev, /* Enough space for 7 features */ len = sizeof(*rp) + (sizeof(rp->features[0]) * 7); - rp = kmalloc(len, GFP_KERNEL); + rp = kzalloc(len, GFP_KERNEL); if (!rp) return -ENOMEM; - memset(rp, 0, len); - #ifdef CONFIG_BT_FEATURE_DEBUG if (!hdev) { flags = bt_dbg_get() ? BIT(0) : 0; |