From: Johan Hedberg Date: Sat, 28 Jun 2014 14:54:05 +0000 (+0300) Subject: Bluetooth: Use kzalloc instead of kmalloc for pending mgmt commands X-Git-Tag: v3.17-rc1~106^2~12^2~41^2~228 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fca20018e7b86a8716511c7681115baa47aca8e4;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index d42c07d..727ae15 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -984,7 +984,7 @@ static struct pending_cmd *mgmt_pending_add(struct sock *sk, u16 opcode, { struct pending_cmd *cmd; - cmd = kmalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); if (!cmd) return NULL;