projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4037a77
)
Bluetooth: Use kzalloc instead of kmalloc/memset
author
Wei Yongjun
<
[email protected]
>
Sat, 10 Sep 2016 12:21:22 +0000
(12:21 +0000)
committer
Marcel Holtmann
<
[email protected]
>
Mon, 19 Sep 2016 18:19:34 +0000
(20:19 +0200)
Use kzalloc rather than kmalloc followed by memset with 0.
Generated by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci
Signed-off-by: Wei Yongjun <
[email protected]
>
Signed-off-by: Marcel Holtmann <
[email protected]
>
net/bluetooth/mgmt.c
patch
|
blob
|
history
diff --git
a/net/bluetooth/mgmt.c
b/net/bluetooth/mgmt.c
index 74179b92ef2285830626e5d943f724947a82ebd3..0ac881cfc646a364757094bc5e5919cc89d1e978 100644
(file)
--- a/
net/bluetooth/mgmt.c
+++ b/
net/bluetooth/mgmt.c
@@
-902,12
+902,10
@@
static int read_ext_controller_info(struct sock *sk, struct hci_dev *hdev,
eir_len = eir_append_data(buff, eir_len, EIR_NAME_SHORT,
hdev->short_name, name_len);
- rp = k
m
alloc(sizeof(*rp) + eir_len, GFP_KERNEL);
+ rp = k
z
alloc(sizeof(*rp) + eir_len, GFP_KERNEL);
if (!rp)
return -ENOMEM;
- memset(rp, 0, sizeof(*rp) + eir_len);
-
rp->eir_len = cpu_to_le16(eir_len);
memcpy(rp->eir, buff, eir_len);