Commit bb20da18 authored by Yihao Han's avatar Yihao Han Committed by Luiz Augusto von Dentz
Browse files

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: default avatarYihao Han <hanyihao@vivo.com>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent 3124d320
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -4397,12 +4397,10 @@ static int read_exp_features_info(struct sock *sk, struct hci_dev *hdev,


	/* Enough space for 7 features */
	/* Enough space for 7 features */
	len = sizeof(*rp) + (sizeof(rp->features[0]) * 7);
	len = sizeof(*rp) + (sizeof(rp->features[0]) * 7);
	rp = kmalloc(len, GFP_KERNEL);
	rp = kzalloc(len, GFP_KERNEL);
	if (!rp)
	if (!rp)
		return -ENOMEM;
		return -ENOMEM;


	memset(rp, 0, len);

#ifdef CONFIG_BT_FEATURE_DEBUG
#ifdef CONFIG_BT_FEATURE_DEBUG
	if (!hdev) {
	if (!hdev) {
		flags = bt_dbg_get() ? BIT(0) : 0;
		flags = bt_dbg_get() ? BIT(0) : 0;