浏览代码

Bluetooth: Use kzalloc instead of kmalloc for pending mgmt commands

By using kzalloc we ensure that there are no struct members, such as the
user_data pointer, left uninitialized.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg 11 年之前
父节点
当前提交
fca20018e7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/bluetooth/mgmt.c

+ 1 - 1
net/bluetooth/mgmt.c

@@ -984,7 +984,7 @@ static struct pending_cmd *mgmt_pending_add(struct sock *sk, u16 opcode,
 {
 {
 	struct pending_cmd *cmd;
 	struct pending_cmd *cmd;
 
 
-	cmd = kmalloc(sizeof(*cmd), GFP_KERNEL);
+	cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
 	if (!cmd)
 	if (!cmd)
 		return NULL;
 		return NULL;